POV-Ray : Newsgroups : povray.beta-test : Restructured Parser wants Testing : Re: Restructured Parser wants Testing Server Time
1 May 2024 04:30:16 EDT (-0400)
  Re: Restructured Parser wants Testing  
From: Stephen
Date: 23 May 2018 13:31:44
Message: <5b05a580$1@news.povray.org>
On 23/05/2018 16:30, clipka wrote:
> Am 23.05.2018 um 16:38 schrieb Stephen:
>> On 23/05/2018 13:55, clipka wrote:
>>> Am 23.05.2018 um 10:22 schrieb Stephen:
>>>
>>>> Test:
>>>>
>>>> v 3.8.0-alpha.9475849+av541.msvc14 is faster than
>>>> v 3.8.0-x. tokenizer.9999+av5 60.msvc
>>>>
>>>> On the second run of the file. The parse time was a second or two slower
>>>> than the first time. Except when using Ver 3.7 when it was the same.
>>>
>>> I take that as good news, presuming the scene in question does call
>>> macros across files. Such a scenario would explain the superior
>>> performance of v3.8.0-alpha over v3.7.0 as the result of macro caching,
>>> as well as the inferior performance of v3.8.0-x.tokenizer vs.
>>> v3.8.0-alpha as the result of disabled macro caching.
>>>
>>
>> Sorry it does not use macros. It did but I de-constructed the grass
>> macro it was using as it was declaring an array of meshes from within a
>> while loop. [Watch the memory usage rise and the HDD thrash.]
> 
> Hmm... then that begs the question, which change between v3.7.0 and
> v3.8.0-alpha would have improved parsing speed?
> 

You mean it is not deliberate? o_O

> Besides, what loop size are we talking about? Would that happen to be
>> 64k characters in the loop body?
> 

I am not too sure I understand.

The loop size depends on the size of the target heightfield and the 
required density of the grass.

Relevant code.

             #declare BoxMin  = min_extent (Trace_patch_aa_) ;
             #declare BoxMax = max_extent (Trace_patch_aa_)  ;
             #declare Density =10000 ;  // User variable
             #declare RootDensity = sqrt(Density) ;




               #local Ox = BoxMin.x;
               #local Oz = BoxMin.z;
               #local Nx = int(RootDensity*sqrt(BoxMax.x - BoxMin.x));
               #local Nz = int(RootDensity*sqrt(BoxMax.z - BoxMin.z));
               #local Dx = Nx/Density;
               #local Dz = Nz/Density;

             union {
               #local I = 0;
               #while(I<Nx)
                #local J = 0;
                #while(J<Nz)
                 #local Z = Oz + ( J + 0.5 ) * Dz + ( rand( Pseed ) - 
0.5 ) * Dz * Pdev;
                 #local Z = ( ( Z < Oz ) ? Z - 2 * Oz : ( Z > -Oz ) ? Z 
+ 2 * Oz : Z );
                 #local X = Ox + ( I + 0.5 ) * Dx + ( rand( Pseed ) - 
0.5 ) * Dx * Pdev;
                 #local X = ( ( X < Ox ) ? X - 2 * Ox : ( X > -Ox ) ? X 
+ 2 * Ox : X );
                 #local W = 2 + ( rand( Wseed ) - 0.5 ) * Wdev;

                        #local Inter = trace ( Trace_object_ , < X , 
BoxMax.y + 100 , Z>,  < 0  ,  -1, 0 >, Norm);

                   #if (vlength (Norm)!=0)

USW


>> I have already had jr complain that I sent him the code in one file and
>> not split into include files.
>> So, what is wrong with 54317 lines in one file, anyway? ;-)
> 
> Nothing. It might actually be perfect for my parser tests. ;)
> 


I thought you might ask for a copy and started to look at how many image 
maps it was using.
It seems that when I was modifying the file manually I forgot to remove 
a couple of flower meshes. I had used in B3D. I cleaned it up and it is 
only 13500 lines now. And one heightfield image.

If you still want a copy. I will post it.
-- 

Regards
     Stephen


Post a reply to this message

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