PDA

View Full Version : #INCLUDE nesting and max. source length



Petr Schreiber
25-08-2005, 16:47
Hi,

I'd like to know if is there any nesting limit for the #INCLUDE ( I mean how many levels deep can #INCLUDE link go )?

And my second question is, what is the maximum number of source lines ?

Thanks, Psch

ErosOlmi
25-08-2005, 18:09
Nesting level should be unlimited.
Of course there are machine/memory/speed limit. thinBasic is an interpreter so, while parsing, not only it checks for syntax errors but actually allocates memory, variable, internal dictionaries and so on.

Maximum number of lines tested without problems, is about 15000.
Hope to be enough for many kind of scripts. thinBasic does not allocate memory by line. There are no internal arrays of strings or things like that. Almost all references are made by pointers to buffers. Of course even in this situation speed execution can be an important factor in case of big scripts.

Optimization
We have still to work regarding internal speed optimization. We are confident to have achieve a good compromize regarding scripts speed execution. In any case we are continuosly working on internal data structures in order to increase speed execution.

ErosOlmi
26-08-2005, 23:32
Max number of sources lines
We were able to make some more deep test on this subject.
We have tested scripts files with more than 45000 lines (mainly variable and equates declaration).

Thanks to this we have found a problem. We were making to much string concatenations and loading time was to high.

We have changed the way script was loading and #INCLUDE clause now works much better.

To have an idea: script with 49000 lines loads in less than 1 sec including loading, parsing and allocations of all global variable declaration.

Test machine: WinXP SP2, P4 2.4Gh, 512Mb RAM.

Next version (1.0.1.2) will have these new improvements.