|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |