Thorsten Froehlich schrieb in Nachricht <36dff57f.0@news.povray.org>...
>In article <MPG.1149eb79f78933399896a1@news.povray.org> ,
eag### [at] telekabel nl
>(Phoenix) wrote:
>
>> In general, the time it takes to read in a jump table is far greater than
>> just using the jump system that gets generated by an if-clause.
>
>That depends a lot on the density of the case conditions you have.
Exactly. IMHO most compilers will do a faster switch() than numerous
if-cascades. See also Ron Parker's output of two compilers. They're both
faster than a simple cascade of if's would be. Now this could be different
for the interpreted POV-script (I still didn't have a look at the code yet)
and interpreted BASIC (I think VB and other "compiled" Basics can handle
switch statements just as well as other languages).
--
Rudy Velthuis
Post a reply to this message
|