Need some input on tips & tricks to speed up my rendering.
I've built my ray tracer using Python 3. This is my first Python effort. Most everything is done uses classes to implement the various pieces. Unfortunately it is really slow, especially at larger dimensions. It took hours to render the first image in Chapter 11 - Reflection & Refraction at 800x400. I've seen references to speeding up the code on this site, but I have been unable to implement any of the concepts. I've seen one site where Numpy was used to speed up another ray tracer, but again I don't know enough to implement it to my code. I've read that using OOP is slower in Python because of the overhead. Any comments? I would appreciate any somewhat detailed implementation details.
I've got an old laptop with a single core and two threads so multiprocessing won't get the times down to anything reasonable. Could others provide their programming language and render time?
One of the biggest ways to speed up your render is to make sure you're caching your inverted matrices. Having to recalculate the inverse of a matrix every time it is referenced is a _lot_ of wasted effort. I've seen some people report speed-ups of several orders of magnitude, just from caching their inverted matrices. If you haven't done that yet, that might be a good place to start.