POV-Ray : Newsgroups : povray.newusers : Parsing Token slowly Server Time: 16 Dec 2018 22:49:23 GMT
  Parsing Token slowly (Message 1 to 4 of 4)  
From: 2762993256@qq com
Subject: Parsing Token slowly
Date: 9 Aug 2017 13:40:00
Message: <web.598b1033466e72516c36883b0@news.povray.org>
I have a big scene document.Rencently I tryed to parse and rendered this scene
document by the exe which run by povray-3.7-stable(open source code).And I find
that Parsing Token is very slowly by this exe,about double times slower compare
with parsing by offical software(POV-Ray v3.7).
And I can get 300 pictures by offical software(POV-Ray v3.7) in 7 hours.
But in 15 hours by the open sourse's exe.
I want to know what cause this phenomenon,and how to solve this problem.


Following is the other question.

Width=1920
Height=1080
Antialias=On
Antialias_Threshold=0.3

Initial_Frame=301
Final_Frame=600
Initial_Clock=301
Final_Clock=600

Start_Row=540
End_Row=540
+F
Output_File_Name="J:\1\results\"

As you can see,this is my ini document,I want to get 300 pictures(from
Initial_Frame=301 to Final_Frame=600).But Every time I need to parsing the same
scene document(very big scene,many many tokens needed to parse) and then
rendering to get a picture.Due to this reason,I waste too many times in parsing
the tokens,cause the time of whole process is very long.
Can I parse the token for once and then just rendering?
Now:parse render parse render....
Hope:parse render render render....

All in all ,I want to accelerate my whole process to get 300 pictures faster.
I am very sorry for my poor English.If you can't understand my mean,I can say
more carefully.Thank you very much!


Post a reply to this message

From: clipka
Subject: Re: Parsing Token slowly
Date: 9 Aug 2017 18:49:30
Message: <598b593a$1@news.povray.org>
Am 09.08.2017 um 15:37 schrieb 276### [at] qqcom:
> I have a big scene document.Rencently I tryed to parse and rendered this scene
> document by the exe which run by povray-3.7-stable(open source code).And I find
> that Parsing Token is very slowly by this exe,about double times slower compare
> with parsing by offical software(POV-Ray v3.7).
> And I can get 300 pictures by offical software(POV-Ray v3.7) in 7 hours.
> But in 15 hours by the open sourse's exe.
> I want to know what cause this phenomenon,and how to solve this problem.

I need more information about the versions you are referring to:

- Am I correctly presuming that by "official software" you mean the
installable Windows version linked to on the official download page
(http://www.povray.org/download/), i.e. POV-Ray v3.7.0[.0]?

- Am I correctly presuming that by "povray-3.7-stable (open source
code)" you mean the version currently available as the head of the
`3.7-stable` branch on GitHub
(https://github.com/POV-Ray/povray/tree/3.7-stable), i.e. POV-Ray v3.7.0.3?

- Am I also correctly presuming that you compiled the latter yourself?
If so, what compiler did you use?

- Are you using the 32-bit, 32-bit SSE2, or 64-bit variant of the software?

Also, am I correctly presuming that by "Parsing Token" you are
specifically referring to the parsing phase of the software's operation,
as opposed to the actual render phase?


Please be advised that the head of the `3.7-stable` branch provides no
functional advantage over official POV-Ray 3.7.0.0 whatsoever. All
changes to the branch only serve to ensure that the 3.7.0 source code
can still be compiled with contemporary compilers.

Also, in case you built your own binaries because you changed the code,
please verify that the slowdown is not caused by your own changes.


> As you can see,this is my ini document,I want to get 300 pictures(from
> Initial_Frame=301 to Final_Frame=600).But Every time I need to parsing the same
> scene document(very big scene,many many tokens needed to parse) and then
> rendering to get a picture.Due to this reason,I waste too many times in parsing
> the tokens,cause the time of whole process is very long.
> Can I parse the token for once and then just rendering?
> Now:parse render parse render....
> Hope:parse render render render....

If your scene contains a lot of computations, then one solution might be
to do those computations only once, and write the results to a file,
which you can read in later. For the best reading performance, you
should write the data as an include file. For example, instead of:

   sphere {
     ComplicatedPosComputationMacro(),
     ComplicatedRadiusComputationMacro()
   }

you could use:

   #if(FirstFrame)
     #local MyGeneratedIncFileName = "precomputed.inc"
     #fopen F MyGeneratedIncFileName write
     #local P = ComplicatedPosComputationMacro();
     #local R = ComplicatedRadiusComputationMacro();
     #write (F,
       "sphere { ",
       ComplicatedPosComputationMacro(), ",",
       ComplicatedRadiusComputationMacro(),
       " }\n")
     #fclose F
     #include MyGeneratedIncFileName
   #end


Of course this does not help if your scene elements are already
precomputed but simply too "heavy" to parse quickly (e.g. a mesh with
gazillions of triangles, or huge texture images). In such a case,
official POV-Ray offers little help.


You might try UberPOV though, which provides a mechanism to keep
selected scene elements from one frame to the next without re-parsing.
To do this, define one or more variables with `#persistent` instead of
`#declare`. Any such variables will then still be defined when the scene
is parsed for the next frame, and you can then skip their definition by
testing whether they are already defined.

So instead of:

    #version 3.70;
    #declare Foo = mesh { ... }

you could use:

    #version unofficial patch 3.70;
    #patch "upov-persistent" 0.1;
    #ifndef(Foo)
      #persistent Foo = mesh { ... }
    #end

For maximum render speed, outsource the actual definition to a separate
include file, and skip that entire file if the variable is already
defined, like so:

    // myScene.pov
    #version unofficial patch 3.70;
    #patch "upov-persistent" 0.1;
    #ifndef(Foo)
      #include "myScene.inc"
    #end

    // myScene.inc
    #persistent Foo = mesh { ... }


Post a reply to this message

From: Kenneth
Subject: Re: Parsing Token slowly
Date: 9 Aug 2017 21:30:00
Message: <web.598b7de5d745264e883fb31c0@news.povray.org>
"276### [at] qqcom" <276### [at] qqcom> wrote:
> ...Every time I need to parsing the same
> scene document(very big scene,many many tokens needed to parse) and then
> rendering to get a picture.Due to this reason,I waste too many times in parsing
> the tokens,cause the time of whole process is very long.
> Can I parse the token for once and then just rendering?
> Now:parse render parse render....
> Hope:parse render render render....

Generally speaking, POV-Ray does this...
     parse render parse render....

It is the way POV-Ray currently works. Clikpa mentioned some ways to speed up
this process. Clipka also mentioned using UBER-POV, which is a separate program
taken from POV-Ray, but it has some additional functions. It can do this...
     parse render render render....

It can use 'persistent' variables that do not need to be re-parsed for every
image. I have not used it yet, so I cannot explain it in detail.


Post a reply to this message

From: clipka
Subject: Re: Parsing Token slowly
Date: 9 Aug 2017 22:56:13
Message: <598b930d$1@news.povray.org>
Am 09.08.2017 um 23:25 schrieb Kenneth:
> "276### [at] qqcom" <276### [at] qqcom> wrote:
>> ...Every time I need to parsing the same
>> scene document(very big scene,many many tokens needed to parse) and then
>> rendering to get a picture.Due to this reason,I waste too many times in parsing
>> the tokens,cause the time of whole process is very long.
>> Can I parse the token for once and then just rendering?
>> Now:parse render parse render....
>> Hope:parse render render render....
> 
> Generally speaking, POV-Ray does this...
>      parse render parse render....
> 
> It is the way POV-Ray currently works. Clikpa mentioned some ways to speed up
> this process. Clipka also mentioned using UBER-POV, which is a separate program
> taken from POV-Ray, but it has some additional functions. It can do this...
>      parse render render render....

Technically speaking it's still

    parse(1) render parse(2) render....

but (2) may inherit some results from (1).


Post a reply to this message

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