|
![](/i/fill.gif) |
clipka wrote:
> .... try copying and pasting the most heavily used macros into the file they are
> used in.
>
> For instance, on my Windows XP machine the following code can be sped up to
> parse *** 25 TIMES FASTER *** by un-commenting the second line:
>
> #include "rand.inc"
> //#macro VRand(RS) < rand(RS), rand(RS), rand(RS)> #end
> #declare R = seed(42);
> #declare i = 0;
> #while (i < 100000)
> #declare V = VRand(R);
> #declare i = i + 1;
> #end
>
> On my Linux machine, it's not that extreme, but still a factor of 12.
>
>
>
This is because each time a macro is called that is in a different file,
the entire containing file is reopened, right? (I remember that from
something in the documentation)
Thinking about that, I'd like to add 'storing macros in memory' for
anything called more than once to the 4.0 SDL wishlist. Most other
compliers do that as far as I know, but I do understand reasons behind
the current behavior, since macros can be huge and all.
Post a reply to this message
|
![](/i/fill.gif) |