POV-Ray : Newsgroups : povray.general : macro speed : Re: macro speed Server Time
4 Aug 2024 20:19:32 EDT (-0400)
  Re: macro speed  
From: Warp
Date: 17 Feb 2003 16:14:58
Message: <3e5150d2@news.povray.org>
Shay <sah### [at] simcopartscom> wrote:
> The following piece of code has two sections. The first section parses
> in 18 seconds on this computer (p3 650m). The second section parses in
> only 9 seconds!!

  This is a very known phenomenon which happens due to how macros are
parsed.
  And due to how they are parsed the effect is even worse if the macro
is inside an include file instead of the current file. Try it.

  If your macro performs some mathematical operation and returns the
result, the fastest way of optimizing this is to replace the macro
with a function (and then it doesn't even matter if the function
is in an include file or not).

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

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