POV-Ray : Newsgroups : povray.text.tutorials : Tips & tricks: How speed-up calculations in loops - part II : Re: Tips & tricks: How speed-up calculations in loops - part II Server Time
26 Apr 2024 14:42:17 EDT (-0400)
  Re: Tips & tricks: How speed-up calculations in loops - part II  
From: Warp
Date: 11 Feb 2002 07:43:27
Message: <3c67bc6e@news.povray.org>

: Nobody likes unrolling 1000000 iterations ;-)

  That's not what loop unrolling means.
  It means that you take a divisor of the number of loops to perform and
"unroll" the body of the loop that many times and decrease the loop index by
that amount.
  That is, if your loop is something like:

#declare Ind = 1000000;
#while(Ind)
  do_something()
  #declare Ind = Ind-1;
#end

you convert it to something like:

#declare Ind = 1000000;
#while(Ind)
  do_something()
  do_something()
  do_something()
  do_something()
  do_something()
  do_something()
  do_something()
  do_something()
  do_something()
  do_something()
  #declare Ind = Ind-10;
#end

  This should parse faster.

-- 
#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.