POV-Ray : Newsgroups : povray.binaries.images : Reading things differently. : Re: Reading things differently. Server Time
23 Apr 2024 04:57:26 EDT (-0400)
  Re: Reading things differently.  
From: clipka
Date: 18 May 2018 22:56:11
Message: <5aff924b@news.povray.org>
Am 18.05.2018 um 21:45 schrieb Kenneth:
> clipka <ano### [at] anonymousorg> wrote:
>> Am 18.05.2018 um 13:11 schrieb William F Pokorny:
>>>
>>> Guessing the magnitude of linear improvement will depend on the SDL
>>> writer's characteristic verbosity(1)?
>>
>> Absolutely. Every character you type (including whitespace) is a
>> character the scanner has to scan. So minimizing your WCV will continue
>> to be good advice(*).
>>
>> (*for getting top parsing speeds; legibility is another matter)
> 
> Pity the poor SDL programmer who includes copious comments in his scene (and
> long variable names) just to make sense of his or her complex scene code. Uh,
> like me :-/

Don't worry - hand-made (and thus documented) /linear/ scenes are rarely
ever long enough to have any noticeable parsing time; and when I'm done
with the parser improvement, in /non-linear/ scenes the WCV will make
virtually no difference anymore, as any comments and whitespace will
then be processed (and discarded) exactly once, even in loops and macros.


> I guess the best recourse is to wait until the scene is 'sealed in stone', then
> make a copy of it for 'real' rendering, stripping out ALL unnecessary stuff
> (including as much whitespace as possible), to get a lean and efficient parse.
> (I'm thinking mostly of a complex animation scene.) I assume that this would be
> good practice in ANY high-level language.

No; with good contemporary high-level languages, WCV makes little
difference, so comments should always stay in there (unless your primary
goal is not to improve parsing speed, but to deliberately obfuscate the
code).

Pretty much the only thing that's slowed down by high WCV is the scanner
stage; and unless a language is implemented as daft as POV-Ray's, that
stage makes for only a very tiny fraction of the time required to
process a program's source code.


Post a reply to this message

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