Profilers and how to interpret results on recursive functions

A even more extreme example for a more complex scene:

> ./target/release/examples/pest_test -i assets/scenes/art_gallery.pbrt

Before:

BVHAccel::recursive_build(...)
PT1028.495833637S seconds for building BVH ...
BVHAccel::flatten_bvh_tree(...)
PT0.018149381S seconds for flattening BVH ...

After:

BVHAccel::recursive_build(...)
PT1.867626813S seconds for building BVH ...
BVHAccel::flatten_bvh_tree(...)
PT0.018222583S seconds for flattening BVH ...

That's 17 minutes vs. 1.9 seconds ... Funny what changing a couple of lines can do :+1:

1 Like