3 ms·
Do any languages have compilers that do this (semi-)automatically? Data layout optimizations are really lacking in the current state of compilers.
by fulafel 10y ago
Do any languages have compilers that do this (semi-)automatically? Data layout optimizations are really lacking in the current state of compilers.
- vellis 10y agoThis. Manual data layout is terrible.
- chrisseaton 10y agoYes! 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.
- adamrezich 10y agoObligatory "Jon Blow's new programming language is all about this and I can't wait to play around with it myself."