POV-Ray : Newsgroups : povray.programming : #macro parsing speed (or the lack of it) : Re: #macro parsing speed (or the lack of it) Server Time
28 Jul 2024 16:26:12 EDT (-0400)
  Re: #macro parsing speed (or the lack of it)  
From: Nathan Kopp
Date: 17 Jan 2000 15:49:47
Message: <3883806b@news.povray.org>
Burton Radons <lot### [at] pacificcoastnet> wrote...
> In general, I don't see much of a difference in speed, about a 5% gain.
> When I put the #while loop in a macro, though, I got a 11% gain, since
> the string's fseek is naturally faster.  Now that's the way macroes
> should be!  Also, when going through an included macro, it's three times
> faster.  Chris should note extreme speed increases.

Burton,

I've adapted your patch (including the update) to MegaPov.  I had to make a
few modifications.  For example, that fread that you mentioned was probably
not platform independent had to be ditched due to CR+LF in the dos/win
environment.

I also have a few ideas about further abstraction of the Data_File struct
(you should have constructors and destructors, IMHO).

Anyway, in Windows this makes a big difference in speed.  As a test, I
rendered "pyramid.pov" (part of the official distribution).  At a recursion
depth of 6, it parsed in 85 seconds in the official 3.1g version, and only
46 seconds in MegaPov.

Then, I modified pyramid.pov so that the creation of the sphere was placed
in a one-line macro in a separate INC file.  Doing it this way led to a
parse time of 260 seconds (4min 20sec) in 3.1g and only 53 seconds in
MegaPov.  :-)  Granted, I intentionally created a macro in a separate file
that would be called very many times from the original file (basically the
worst-case scenario for the official version), but still....

Thanks for your contribution!

-Nathan


Post a reply to this message

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