POV-Ray : Newsgroups : povray.unofficial.patches : Post-process : highlights/midtone/shadows : Re: Post-process : highlights/midtone/shadows Server Time
2 Sep 2024 12:13:36 EDT (-0400)
  Re: Post-process : highlights/midtone/shadows  
From: Warp
Date: 28 Apr 2000 10:36:56
Message: <3909a208@news.povray.org>
I still think that some type of byte-compiling of the povray script
before parsing it would speed up parsing a lot.
  What I mean is that povray could work as perl does (AFAIK): First it
reads the script and byte-compiles it to a binary format, which is kind
of "machine code" or "assembler" into memory. Then it interprets this
byte code.
  This makes it much faster then interpreting the raw script, specially when
there are loops. It's much faster because all the keywords are very short
(1 or 2 bytes usually) and can be read into one variable and processed as
a number, it can trust that there are no syntax errors (because all the
possible syntax errors have been caught in the compilation step) and thus
doesn't have to make provision for that, and so on. Macros would be a lot
faster because they could be kept in memory as byte code and parsed when
needed.
  Usually the time spent byte-compiling plus then interpreting the byte code
is a lot shorter than interpreting the raw script directly (specially, as I
said, with loops and macros).
  Another advantage would be that the byte-compiled version could be written
to a file making the scene file a lot smaller (and saving the compilation
step when reading this binary format; it could just load the file into
memory and start interpreting it).

  Of course it would need a lot of work to implement this (perhaps too much?).

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

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