|
|
"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
|
|