POV-Ray : Newsgroups : povray.advanced-users : Parsing macros can be expensive Server Time
2 Nov 2024 09:19:11 EDT (-0400)
  Parsing macros can be expensive (Message 1 to 4 of 4)  
From: Remco de Korte
Subject: Parsing macros can be expensive
Date: 19 Jan 2000 19:44:14
Message: <3886580E.EBED063F@xs4all.nl>
I've stumbled upon what I think is an interesting discovery.

I have a scene with a mesh created with a loop. Each time the loop has
to do a rather complex calculation on four points. To save me typing and
make it easier to make changes I put the calculation in a macro with a
couple of parameters that would slightly change for each point (five to
be exact). This way the scene took over 43 minutes to parse (AMD K6
500Mhz). I think the macro was called about a million times.

After some renders I decided to put the calculation back into the loop.
This way you get four times more or less the same code but I thought it
might be easier on the parser because it didn't have to jump to another
line each time. The result was stunning: parsing time now was slightly
over 16 minutes!

I'll keep that in mind in the future...

Remco


Post a reply to this message

From: David Fontaine
Subject: Re: Parsing macros can be expensive
Date: 19 Jan 2000 20:01:36
Message: <38865BD9.6554D62E@faricy.net>
How 'bout a POV-script compiler? Too much work ya say? Bah! Back when I was
your age we programmed databases with ones and zeroes. Sometimes only
zeroes.

--
Homepage: http://www.faricy.net/~davidf/
___     ______________________________
 | \     |_       <dav### [at] faricynet>
 |_/avid |ontaine      <ICQ 55354965>


Post a reply to this message

From: Margus Ramst
Subject: Re: Parsing macros can be expensive
Date: 19 Jan 2000 22:07:34
Message: <38867C6D.59C067EB@peak.edu.ee>
Take a look at thread '#macro parsing speed (or lack of it)' in .programming
Burton Radons has made modifications to the macro code which supposedly makes it
work faster. Nathan has also incorporated it in MegaPov.

Margus

Remco de Korte wrote:
> 
> I've stumbled upon what I think is an interesting discovery.
> 
[snip]


Post a reply to this message

From: Remco de Korte
Subject: Re: Parsing macros can be expensive
Date: 20 Jan 2000 05:58:31
Message: <3886E9BF.6C63A6F2@xs4all.nl>
Margus Ramst wrote:
> 
> Take a look at thread '#macro parsing speed (or lack of it)' in
> .programming
> Burton Radons has made modifications to the macro code which
> supposedly makes it
> work faster. Nathan has also incorporated it in MegaPov.
> 
> Margus
> 

Sorry, I don't read that group so I missed that.

I more or less expected that everyone knew about this but me...

Remco


Post a reply to this message

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