On 1/29/23 18:50, Bald Eagle wrote:
> W. F. Pokorny recently commented that floor () was "expensive"
> I wanted to get some idea of HOW expensive any given function was, in the grand
> scheme of things.
Interesting. Measuring the cost of functions in POV-Ray can be tricky.
For starters, usage falls roughly into three buckets. Namely:
1) Pure SDL calls to SDL internally wrapped C++ functions.
2) Calls from SDL of the VM implemented forms of functions.
3) Calls to VM functions from parse time 'compiled' code.
One happens while parsing; Two usually while parsing, but sometimes
while rendering; Three usually while rendering, but this can be a 'parse
phase' thing too.
At the bottom, for standard math functions, one usually calls the C++
implementation inside the VM too. There is always a C++ pow()
invocation, for example, but the POV-Ray calling path/method and wrapper
code around pow() changes.
I expect you are measuring purely SDL parse time performance - (1) -
without any attempt at removing the SDL looping cost ?
Aside 1 : Somewhere I posted a chart where I measured a few functions
with respect to (1) and (3). I had plans for something more complete,
but the work long stalled...
Aside 2 : The handling of function call exceptions is varied in the SDL
and VM implementations. If invalid calls are made, the execution might
or might not stop as viewed by the user. I 'suspect' non-stopping,
invalid calls could significantly skew performance measurements -
depending also on how POV-Ray was compiled.
Post a reply to this message