POV-Ray : Newsgroups : povray.general : Does declaring an object reduce the rendering time? : Re: Does declaring an object reduce the rendering time? Server Time
13 Jul 2024 08:10:45 EDT (-0400)
  Re: Does declaring an object reduce the rendering time?  
From: Alain Martel
Date: 4 May 2020 17:53:37
Message: <5eb08ee1$1@news.povray.org>
Le 2020-05-03 à 13:24, Kima a écrit :
> Alain Martel <kua### [at] videotronca> wrote:
>>
>> If, instead of spheres, you used some meshes, then, there would have
>> been a huge reduction on memory use.
>> In this case, the first form would need to store each individual meshes
>> while the second would instantiate a single mesh.
>>
>> When using meshes, the reduction in memory use can prevent paging that
>> can dramatically bog down the rendering. It may even mean the difference
>> between been able to render at all and crashing.
> 
> I'm very much interested in meshes. Does declaring the mesh affect the rendering
> time?
> 
> I have 32/64 cores and 128GB memory. My CPU usage always reaches 100% but I
> hardly see any memory consumption. This is the reason that my only concern is
> the CPU usage.
> 
> 
> 

POV-Ray is pretty efficient in it's memory use because it use procedural 
primitives.
What use the most memory per object are single use mesh, image_map, the 
images used as data source for height_field.
Next, using thousands, or even millions of objects.
Obviously, radiosity and photons scene need some extra memory.
You also need more memory if you want to render a larger image.

Using many instances of declared meshes will save memory as the mesh 
reside in memory only once, but have no effect on the CPU usage and 
render speed. If you are short on memory, not your case, that can have a 
huge impact by preventing the use of virtual memory. If that happens, 
you'll notice a marked decrease in CPU use.



Do a small test :
Have an include file defining a mesh WITHOUT using #declare.

In a loop, #include "Meshfile.inc" about 1000 times with some translation.
Take note of the memory use, parse time and render time.

Next, use
#declare MeshName = #include"Meshfile.inc"
then use it as many times.
Take note of the memory use, parse time and render time and compare.

Both should have the same, or almost same, render time.
Parse time should differ quite a bit.
Memory use should be very different.


Post a reply to this message

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