POV-Ray : Newsgroups : povray.unix : Something for those after performance Server Time
28 Jul 2024 06:25:08 EDT (-0400)
  Something for those after performance (Message 1 to 1 of 1)  
From: William F  Pokorny
Subject: Something for those after performance
Date: 23 Aug 2002 17:49:37
Message: <3D66ADF2.A6E55B6@attglobal.net>
Looking around in the source I started to wonder how much time was being spent keeping
track of all
those stats.  It turns out about 3%. For those interested in a mere 3% you can get it
by changing
the lines:

#define Increase_Counter(x) { if ((++(x).low) == 0L) { (x).high++; } }
#define Decrease_Counter(x) { if ((--(x).low) == (unsigned)(-1L)) { (x).high--; } }

in the file frame.h to:

#define Increase_Counter(x)
#define Decrease_Counter(x)

I think this record keeping costs more than I expected because it is keeping track of
low and high
order longs for 64 bit precision. The implementation has to do a minimum of an
increment and an
equality test each time.  Global variables are used to store the counts which will
hinder compiler
optimizations.  There is a low resolution counter available in the source code which
only does the
increment. You can get it by setting COUNTER_RESOLUTION to LOW_RESOLUTION, but I
expect 32 bits is
not enough, hence the default.

The obvious downside is, of course, you get no statistics in the output, but I'd guess
for many
renders this would be OK.

If those of you who better know the source are aware of some side effect to this hack
I don't see,
please speak up.
Bill P.


Post a reply to this message

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