edin / raytracer

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

Copy cpp #4

Closed shirleyquirk closed 3 years ago

shirleyquirk commented 3 years ago

the main reason the original is so slow, even after using the correct compiler flags, is the extra branching that isn't present in the cpp version. it was easier for me just to rewrite the whole thing rather than trying to make a light diff, but the results speak for themselves: without the extra math optimizations i couldn't help putting in (-d:intpow -d:quake --passC:"-march=native") i get 55ms vs 74 for c++, and with them that goes down to 37ms

edin commented 3 years ago

Thanks!

Nim is amazing with this template / macro stuff that I should learn how to use.