Open sprunk opened 11 months ago
Old measurement #4132
The neat thing about iterable map is the internals can be modified to be whatever is fastest, and a lot of stuff will automatically update. The barbarian stuff would be annoying though, but mostly routine.
Well if measurements confirm that pairs
is the fastest then I'm not sure if it's worth having because that is also what's already the most idiomatic. Same way you wouldn't have AddNumbers(x, y)
with customizable internals if it turned out that x + y
is faster than whatever complex bit hax microoptimisation one could come up with, because that just makes working with code harder.
Though this is just an elegance thing, people can ignore the existence of IterableMap
and use pairs
regardless with no ill consequences.
Apply and ApplyFraction are nice.
Recent engines offer better tracing/profiling tools (Tracy) and Beherith claims that
pairs(map)
is faster than even theIterableMap.GetBarbarianData
interface). Perhaps worth repeating whatever measurements had originally been made, or just measure existing use cases of iterable map, because if it's faster to just use pairs then most uses of iterable map can be thrown out (simplicity is king).It does offer some nice features (constant-time count, random element, staggered iteration) so it shouldn't be completely removed though.