|
![](/i/fill.gif) |
In article <chrishuff-99F94F.13380822022001@news.povray.org>, Chris
Huff <chr### [at] mac com> wrote:
> The macro version used 238 seconds, and the function version used 208
> seconds, so the function version takes about 87% as long as the macro.
I decided to do a more accurate calculation by subtracting out the
"overhead" of the rest of the scene (by replacing the call to the macro
or function with a 0), and found out a surprisingly large portion of the
time was spent in the loops themselves...and the function is a great
deal faster than the macro.
The scene with no calls but the same number of repetitions used 204
seconds, so the total time used by the function was 4 seconds and the
total time used by the macro was 34 seconds. The function only takes
about 11.7% as long as the macro...nearly 10 times faster.
Which figure is more relevant? The 11.7% is a better comparison of the
speed of the macro with the speed of the function, but the 87% figure is
closer to what you will see in real life...you will probably have the
call nested in a bunch of loops and other macro calls. Only a small
portion of the time was actually spent in the macro/function call.
--
Christopher James Huff
Personal: chr### [at] mac com, http://homepage.mac.com/chrishuff/
TAG: chr### [at] tag povray org, http://tag.povray.org/
<><
Post a reply to this message
|
![](/i/fill.gif) |