POV-Ray : Newsgroups : povray.programming : LOW_RESOLUTION statistics broken : Re: LOW_RESOLUTION statistics broken Server Time
4 Oct 2024 17:09:14 EDT (-0400)
  Re: LOW_RESOLUTION statistics broken  
From: Vadim Sytnikov
Date: 8 Jan 2003 08:05:22
Message: <3e1c2212$1@news.povray.org>
"Thorsten Froehlich" <tho### [at] trfde> wrote
> No, sorry, too much depends on it to offere a general "disable all"
switch.
> However, if you think statistic counters in certain places cause too much
> overhead, let me know and either conditional compilation for some can be
> added or a better solution can be developed.

The following code (compiled upon COUNTER_RESOLUTION==0) outlines what I
did:

#define DBL_Counter(x)       0.0 /* ( (DBL)(x) ) */
#define Long_To_Counter(i,x) i /* { (x) = i; } */
#define Init_Counter(x)      /* { (x) = 0L; } */
#define Increase_Counter(x)  /* { (x)++; } */
#define Test_Zero_Counter(x) 1 /* ((x) == 0L) */
#define Add_Counter(x, a, b) /* { (x) = (a) + (b); } */
#define Decrease_Counter(x)  /* was undefined for 32-bit counters */

There appeared to be some "divides by zero" (compile-time, *not*
execution-time errors) in Print_Stats() (statspov.cpp module), so I
conditionally switched off a bunch of code in that function as well. I do
understand that that may not be appropriate for an official version; but
other than that, there appeared no problems. I do think this would be useful
in render-farms and the likes; 64-bit counters on 32-bit architectures
introduce extra branches, which definitely do no good for Pentiums with
their pipelines...


Post a reply to this message

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