Live data from Hacker News

Game Engine Containers – handle_map

gamedev.net

11–17 of 17 posts

Re: Game Engine Containers – handle_map

#13
post #9

Do any languages have compilers that do this (semi-)automatically? Data layout optimizations are really lacking in the current state of compilers.

Yes! I work on a dynamic compiler (also known as a JIT) for Ruby that will for example represent small hash maps as a single allocation of a linear consecutive set of keys and values. This helps further optimisations such as escape analysis, scalar replacement and loop unrolling, which in turn improve the effectiveness of inline caching and then inlining, splitting and specialisation. So after all that it can have quite an impact, beyond simply being more cache friendly.

Re: Game Engine Containers – handle_map

#14
post #9

Do any languages have compilers that do this (semi-)automatically? Data layout optimizations are really lacking in the current state of compilers.

Obligatory "Jon Blow's new programming language is all about this and I can't wait to play around with it myself."

Re: Game Engine Containers – handle_map

#15
You should use maps in game engines parsimoniously and when you do, use integer keys like a hash or something. This should be evident for any game programmer.

If you are at the point of inventing a more complex structure to compensate for programmer mistakes and/or malpractice, I suspect you should fire or reassign people instead of coding this.

But meh, I'm probably getting too old/grumpy... lol

Re: Game Engine Containers – handle_map

#16

You should use maps in game engines parsimoniously and when you do, use integer keys like a hash or something. This should be evident for any game programmer. If you are at the point of inventing a more complex structure to compensate for programmer mistakes and/or malpractice, I suspect you should fire or reassign people instead of coding this. But meh, I'm probably getting too old/grumpy... lol

STL containers aren't the most optimized things for game programming ever... otherwise the EASTL[0] wouldn't be a thing.

[0] https://github.com/electronicarts/EASTL

Re: Game Engine Containers – handle_map

#17

You should use maps in game engines parsimoniously and when you do, use integer keys like a hash or something. This should be evident for any game programmer. If you are at the point of inventing a more complex structure to compensate for programmer mistakes and/or malpractice, I suspect you should fire or reassign people instead of coding this. But meh, I'm probably getting too old/grumpy... lol

STL containers aren't the most optimized things for game programming ever... otherwise the EASTL[0] wouldn't be a thing. [0] https://github.com/electronicarts/EASTL

It's also very optimal not to use a map when you don't really need one, that's my point.

I agree eastl is cool, I clearly remember smilling when it first came out.

Post reply on HN