Ralith / hecs

A handy ECS
Apache License 2.0
921 stars 79 forks source link

Add block_box to benches #342

Open a1phyr opened 9 months ago

a1phyr commented 9 months ago

This makes iterate_* benches far more stable and less code layout dependent.

Ralith commented 9 months ago

I'm not sure this the right place for it. We want the compiler to be able to aggressively optimize the interior of the loop; if it can't, that means the iterator code is probably too complex and obscuring things. In the benchmarks we should only be concerned about work being deleted entirely, rather than just rearranged, and I haven't seen evidence that. If we did see that it could probably be handled with a single black_box application to the entire world after the loop.

Separately, maybe we should use the now stable and presumably more reliable std::hint version?