POV-Ray : Newsgroups : povray.beta-test.binaries : Function / pattern issues. New inbuilt f_agate(). : Re: Function / pattern issues. New inbuilt f_agate(). Server Time
29 Apr 2024 11:50:32 EDT (-0400)
  Re: Function / pattern issues. New inbuilt f_agate().  
From: Thorsten Froehlich
Date: 4 Jun 2020 17:10:05
Message: <web.5ed9625b5333712c8e3283b10@news.povray.org>
William F Pokorny <ano### [at] anonymousorg> wrote:
> On 5/7/20 9:45 PM, William F Pokorny wrote:
> ...
> > In a surprise, I expected f_agate() to be a little slower than the
> > inbuilt used as a pattern in a pigment, for example. It's running about
> > 16% faster for reasons not currently understood. This the first pattern
> > where - other than f_dents which is cheap - the inbuilt function
> > implementation can match the pattern one exactly. (My f_granite23
> > inbuilt doesn't match granite.) A mystery for another day.
> ...
>
> A significant part of the performance degrade in the normal agate
> pattern looks to be due the use of a dynamic_cast(1) while it checks
> which turbulence warp exists / is the internal agate one. So, other
> special turbulence patterns likely have this slow down too - though I've
> not tested them.

You mean this train wreck of a C++ function that is abusing dynamic cast for a
type check?

bool AgatePattern::Precompute()
{
    return (!warps.empty() && dynamic_cast<ClassicTurbulence*>(*warps.begin()));
}

Oh hell, if the remaining code was turned into such a pile of junk :-( :-( :-(


Post a reply to this message

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