Conversation
Click to expand benchmark resultsTime is per entity/N, allocations are totals. Allocations are only shown for current.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
the effect on performance is kind of bad, though I don't think we have better alternatives |
|
By the way, this avoids UB in two cases as far as I can see:
Maybe the second case is being too paranoid, if we want to fix only the first one I think less impactful changes are possible |
|
I think both are not really valid use cases, as the function is not guarenteed to return the correct result. Both cases may produce entities that are not really valid, but are seen as alive due to having the "correct" generation. So maybe it would be sufficient to just enable bounds checks, but not catch that case explicitly? |
|
Yes this is sensible to me...Though enabling bound checking has the same perf degradation than this more or less |
|
Ok, maybe another strategy: we can probably reset the pool without resizing. Will make reset more costly, but we can avoid bounds checks. |
|
yes, though this will work just for the first case, not the second one, though to me it is okay that the second one remains unsafe since it seems really unimportant |
|
Maybe we should really recycle/"kill" all entities. For a reset world, we would then get the true alive state. |
This function was unsafe before and could cause UB since it is called directly from the public
is_alive