| ▲ | adrian17 4 hours ago | ||||||||||||||||||||||
> Also, as you're using full double/f64-precision all the time, you're leaving a fair bit of performance on the table There's another issue that popped up on my quick naive profiling run: std::shared_ptr<Material> in the HitRecord/HittableLightSample is assigned/copied and destroyed a lot, and somehow these refcount operations show up as half of all samples on my profile (presumably because even if there's no hit and the pointer stays nullptr, the smart pointer still must check if there's anything to deallocate). | |||||||||||||||||||||||
| ▲ | pixelesque 4 hours ago | parent [-] | ||||||||||||||||||||||
Yeah, passing std::shared_ptr by value in a multi-threaded setup can have a lot over overhead due to them being copied and destroyed a lot, and the fact that the atomic ref count value modifications effectively cause a write back to cache and can cause contention. Should pass them by const refs really to avoid this. | |||||||||||||||||||||||
| |||||||||||||||||||||||