POV-Ray : Newsgroups : povray.advanced-users : Parsing macros can be expensive : Parsing macros can be expensive Server Time
30 Jul 2024 06:32:01 EDT (-0400)
  Parsing macros can be expensive  
From: Remco de Korte
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

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