edin / raytracer

Performance comparison of various compilers
MIT License
57 stars 22 forks source link

Rust performance tweaks, code simplifications, more accurate timing. #16

Closed jzakiya closed 3 years ago

jzakiya commented 3 years ago

This PR presents a number of tweaks.

1: uses more efficient|simpler|faster code equivalents in some places. 2: condenses many "noisy" { curly brackets, does simpler refactors, removes unneeded returns, uses simpler code in places. 3: uses a timing loop to more accurately determine the average execution time for one run.

Testing on my system, with timing loop n = 100 produces consistently 1 - 2 ms faster times.

edin commented 3 years ago

Thanks, I'll check it later, for time measurement I would like to render the scene only once and use some external tool to repeat the test multiple times and average the results.