That's correct John.
Recursion is always a stress on system resources, and this is indeed a stress test even if it does little more than just add a 1 to an x.
Batch preallocation can improve the speed dramatically if SB would only allow for something like DIM instead of FOR/NEXT. You should understand that of those 11 minutes spent in user code 10.58 minutes were spent in SB's
MyAlloc that was reordering its pieces of pool memory to yield just one array element at a time.
Can we somehow concatenate two similarly structured SB arrays -- one used up, and another one, a fresh batch allocation -- without the need to copy at least one of the arrays on the user side of SB interface, i.e. totally within SB's engine machine code? Something like FBSL's ArrayMerge() function?
I assume you are already doing something like this for FBSL. (REDIM to expand array)
Yes, DIM[1K]/REDIM PRESERVE[UBOUND+1K] would be the fastest scheme to follow. Upon closer consideration, it would be the most flexible too. This is because FBSL's dynamic arrays, fast as they are, are growable but not shrinkable; you can't UNDEF an FBSL dynamic array. OTOH REDIM and even REDIM PRESERVE work both ways and are fast enough in batch (re)allocation. In one-element-at-a-time (re)allocations however they would work at approximately the same speeds as what we're seeing in SB now.