gkjohnson / three-bvh-csg

A flexible, memory compact, fast and dynamic CSG implementation on top of three-mesh-bvh
MIT License
548 stars 45 forks source link

Perform benchmarking to determine where slowdowns are #165

Open gkjohnson opened 9 months ago

gkjohnson commented 9 months ago

Build timing tool

gkjohnson commented 8 months ago

Some timings. Measuring the timing in tight loops causes things to take longer - but the whole triangle traversal logic and half edge traversal logic is fairly slow. We should be able to traverse them more quickly, I'd think

image
total                : 226.800ms
bvhcast              : 35.200ms
split                : 63.200ms
whole                : 126.600ms
total                : 548.500ms
bvhcast              : 33.100ms
split                : 86.000ms
split.init           : 1.400ms
split.splitting      : 10.200ms
split.hitside        : 43.600ms
split.getAction      : 4.900ms
split.append         : 8.600ms
whole                : 427.100ms
whole.initstack      : 26.200ms
whole.traverse       : 400.700ms
whole.hitSide        : 0.000ms
whole.getSiblings    : 106.800ms
whole.append         : 128.400ms