Hello Mansour
>> "When I just load stzlib, the issue is observed: 10.910 seconds!"
This happens because the Range Operator create the list by allocating for each item one by one
This is fast when we have enough items in the memory pool
Loading StzLib consumes most of these items in the memory pool
To have better performance, use the List() function
Example:
load "stzlibconfig.ring"
load "stzlib.ring"
decimals(3)
t1= clock()
mylist = list(100_000) // Allocate memory block for all items instead of using the memory pool
for t=1 to 100_000 mylist[t] = t next
? myIsListOfNumbers(mylist)
t2= clock()
? (t2-t1)/clockspersecond()
func myIsListOfNumbers(paList)
if NOT isList(paList)
return 0
ok
nLen = len(paList)
for i = 1 to nLen
if not isNumber(paList[i])
return 0
ok
next
return 1
Output:
1
0.025
Greetings,
Mahmoud