POV-Ray : Newsgroups : povray.general : In case your scene parses too slow... : Re: In case your scene parses too slow... Server Time
30 Jul 2024 10:18:52 EDT (-0400)
  Re: In case your scene parses too slow...  
From: CShake
Date: 17 Apr 2009 21:22:59
Message: <49e92b73$1@news.povray.org>
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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.