|
|
In article <3d50350b$1@news.povray.org>,
"Tim Nikias" <tim### [at] gmxde> wrote:
> What is actually easier for POV to parse,
> (Float_Value*2) or (Float_Value+Float_Value)?
>
> Does it make a difference? I tend to recall that
> I've learned somewhere that any parser/CPU has
> to do some extra job to break down the "multiply with
> 2" into something it can actually calculate, while
> "add" is very simple and clean to do for a CPU.
The differences between CPU instructions are so little compared to the
parser overhead that you probably couldn't even measure the difference,
and modern processors are so much more complex that it isn't even worth
thinking about, and modern compilers will automatically optimize many
things...the multiply by 2 might end up faster than an add.
However, for POV: the first version has fewer characters, so the current
parser would probably parse it a little more quickly. If used in a
function, there would be no noticeable difference in how fast the
function executed.
--
Christopher James Huff <chr### [at] maccom>
POV-Ray TAG e-mail: chr### [at] tagpovrayorg
TAG web site: http://tag.povray.org/
Post a reply to this message
|
|