POV-Ray / povray

The Persistence of Vision Raytracer: http://www.povray.org/
GNU Affero General Public License v3.0
1.35k stars 282 forks source link

Cache Images for faster parsing subsequent images (or frames in animation) #396 #398

Open mlsomers opened 4 years ago

mlsomers commented 4 years ago

Loading large images during parsing can take ages. When rendering animations these images are reloaded before rendering each frame.

With this solution the images are only loaded once and cached for reuse when parsing the next frame. This can dramatically decrease parsing time.

Be free to point out any errors, this is my first serious C++ code written ever (normally I do C#). The code has been tested and I don't see any significant memory leakage, in fact I am already using this in production (and it is saving lots of resources!).

I asked for this feature in issue #395 , instead of waiting for it I embarked on this rewarding quest.