by amluto · 2y ago · 0 comments
Indeed, Parquet will do this for you if you let it.
I also wonder how good Java is at optimizing closure creation in a loop, as in:
k -> new ResultObserver()
The vast majority of those closures are created and never called. C++ might optimize this well if calling a template but has basically no chance if the parameter is an std::function. Java probably has more ability to optimize it, but I don’t know whether it actually does so.GraalVM is the SOTA in the JVM world for this.
Here's an oldish blog on this: https://chrisseaton.com/truffleruby/seeing-escape-analysis/
I'm sure PEA is better now, but it's not sure if it's moved beyond scalars (int, float, etc.)
invokedynamic #16, 0 // InvokeDynamic #0:apply:()Ljava/util/function/Function;(One think I like about less heavily JIT-reliant languages is that it can be more obvious when something will incur a runtime cost.)