POV-Ray : Newsgroups : povray.newusers : Parsing Q Server Time
25 Nov 2024 05:48:12 EST (-0500)
  Parsing Q (Message 1 to 8 of 8)  
From: Bryan Heit
Subject: Parsing Q
Date: 28 May 2006 13:56:17
Message: <4479e441$1@news.povray.org>
I'm preparing to do a high quality render of an animation I've setup. 
Because of the large size of the animation (15,800 frames, 720x480) I'm 
looking for any way to improve rendering speed.  The animation is 
divided into 22 "scenes", each one of which is regulated using if 
statements.  I was wondering if the material between the #if and #end 
portions of a scene are still parsed if the #if statement is false.  Or, 
in other words, if it would be faster to delete or comment out portions 
of the animation not being used in the current round of rendering.

Bryan


Post a reply to this message

From: M a r c
Subject: Re: Parsing Q
Date: 28 May 2006 14:12:44
Message: <4479e81c$1@news.povray.org>

news:4479e441$1@news.povray.org...
> I'm preparing to do a high quality render of an animation I've setup.
> Because of the large size of the animation (15,800 frames, 720x480) I'm
> looking for any way to improve rendering speed.  The animation is
> divided into 22 "scenes", each one of which is regulated using if
> statements.  I was wondering if the material between the #if and #end
> portions of a scene are still parsed if the #if statement is false.  Or,
> in other words, if it would be faster to delete or comment out portions
> of the animation not being used in the current round of rendering.
>
> Bryan
According to the documentation, the portion between #if and #end is skipped
if the condition is false

http://www.povray.org/documentation/view/3.6.1/241/


Marc


Post a reply to this message

From: Florian Brucker
Subject: Re: Parsing Q
Date: 28 May 2006 15:31:03
Message: <4479fa77$1@news.povray.org>
As Marc already told you, there's no need to remove those sections. For 
some more tips on speeding up POV-Ray renders check out the POV-Ray 
speed guide:

	http://povray.tirnalong.com/ow.asp?p=SpeedGuide


HTH,
Florian


Post a reply to this message

From: Warp
Subject: Re: Parsing Q
Date: 29 May 2006 04:28:58
Message: <447ab0c9@news.povray.org>
M_a_r_c <jac### [at] wanadoofr> wrote:
> According to the documentation, the portion between #if and #end is skipped
> if the condition is false

  *Interpreting* that part is skipped, but POV-Ray has to go through it
in order to find the proper #else or #end in the first place. It can't
magically know where it is located if it doesn't go through the tokens
in the scene.
  IOW it will parse the body of the #if (in order to find the #else or #end)
but it will not interpret it.

-- 
                                                          - Warp


Post a reply to this message

From: M a r c
Subject: Re: Parsing Q
Date: 29 May 2006 07:15:45
Message: <447ad7e1$1@news.povray.org>

news:447ab0c9@news.povray.org...
>   IOW it will parse the body of the #if (in order to find the #else or
#end)
> but it will not interpret it.
>
> -- 
>                                                           - Warp

It should be faster than real parsing isn't it?

Marc


Post a reply to this message

From: Florian Brucker
Subject: Re: Parsing Q
Date: 29 May 2006 10:34:26
Message: <447b0672$1@news.povray.org>
> It should be faster than real parsing isn't it?

Depends, I guess: Consider this scene:

	#if (0)
		#declare b = 0;
		#while (b<1000000)
			sphere { x*b, 0.5 pigment { rgb 1 } }
			#declare b = b + 1;
		#end
	#else
	#end

Parsing it takes 0 seconds (Because the loop is parsed, but not 
executed). But if you replace the loop with actual data, like this:

	#if (0)
		sphere { x*0 0.5 pigment { rgb 1 } }
		sphere { x*1 0.5 pigment { rgb 1 } }
		sphere { x*2 0.5 pigment { rgb 1 } }
		...
		sphere { x*999997 0.5 pigment { rgb 1 } }
		sphere { x*999998 0.5 pigment { rgb 1 } }
		sphere { x*999999 0.5 pigment { rgb 1 } }
	#else
	#end

Parsing takes 11 seconds, because this time each sphere has to be parsed 
separately.

So if you're long parsing times are caused by lengthy calculations in 
loops or recursion (but are short in terms of lines of SDL), then 
removing them won't really shorten parse time. But if they are caused by 
"real parsing", you're better off moving that data to an include file:

	#if (0)
		#include "test2.pov"
	#else
	#end

Takes 0 seconds to parse (test2.pov contains the 10000000 sphere 
definitions from above).


HTH,
Florian


Post a reply to this message

From: Bryan Heit
Subject: Re: Parsing Q
Date: 29 May 2006 10:44:04
Message: <447b08b4$1@news.povray.org>
Florian Brucker wrote:
> As Marc already told you, there's no need to remove those sections. For 
> some more tips on speeding up POV-Ray renders check out the POV-Ray 
> speed guide:
> 
>     http://povray.tirnalong.com/ow.asp?p=SpeedGuide
> 
> 
> HTH,
> Florian

Thanx everyone for the info.

Bryan


Post a reply to this message

From: Warp
Subject: Re: Parsing Q
Date: 30 May 2006 14:40:49
Message: <447c91b1@news.povray.org>
M_a_r_c <jac### [at] wanadoofr> wrote:
> It should be faster than real parsing isn't it?

  I think you are confusing terms here.

  Parsing a script means to split it (internally) into meaningful tokens.
Interpreting it, which you call "real parsing" is to act upon those tokens.

  POV-Ray has to parse the file in order to find the proper #end.

-- 
                                                          - Warp


Post a reply to this message

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