POV-Ray : Newsgroups : povray.general : POV Parsing : Re: POV Parsing Server Time
9 Aug 2024 03:23:11 EDT (-0400)
  Re: POV Parsing  
From: David Fontaine
Date: 29 Aug 2000 17:11:04
Message: <39AC24B1.AC940652@faricy.net>
Warp wrote:

>   Byte-compiled code will be faster to parse only when you have big loops
> (I mean "big" in number of iterations), macros and so on. Reading a regular
> file without them will only slow the parsing (because it has to first parse
> it, as it does now, byte-compile it and then interpret that byte code).

I frequently find myself making the cimputer do the work, as in the research
outpost I just posted, my spiral forest, my crystal macro, my polyhedral
snowflakes.

>   One advantage of byte-compiling is that you could save the binary data
> to a file and then read it afterwards, saving the parsing and compilation
> steps.

Yup!

>   A disadvantage of writing byte-coded binary data is that it's
> system-specific and something written in one system may not work in another
> system (because of different endianess, different floating point number
> formats and so on). This, however, shouldn't matter when you are only
> working for yourself. You can always give the source code in plain ascii
> to others.

I was thinking, not compiling it to machine code, but compressing the text. Ie,
have a one or two byte code for each keyword. Searching through that would be
instantaneous compared to text searching. But word seems to have it POV already
does this type of thing to some extent.

>   By the way, as far as I know perl uses this tactique, that is, it first
> parses the source script, byte-compiles it and then interprets this byte code.
> This makes perl one of the fastest scripting languages in existence.
>   And since perl "compiles" in the background, hidden from the user, the user
> doesn't have to worry about the compilation step (as happens with java).
>   But as I said, byte-compiling is beneficial only when there are loops and
> other similar things in the code.

I don't think it would add much to parse time for non-cpu-intensive-parsing
scenes, which usualy parse fast anyway. My big LEGO scenes parse in a matter of
minutes if not seconds, compared to half an hour or an hour for cpu-intensive
parses.

> : I've stored integers between 0 and 10 in an array of doubles...
>
>   Usually a bad idea :)

Yes, but it's the only option in POV-script!

--
David Fontaine   <dav### [at] faricynet>   ICQ 55354965
Please visit my website:  http://davidf.faricy.net/


Post a reply to this message

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