Open plokhotnyuk opened 6 years ago
I'm not sure this is exactly a bug, but rather an effect of how boxing works. LongMap
stores its Long
keys unboxed; the foreach
etc. methods are generic and require boxed values. Graal is sufficiently clever to realize that boxing and then usage is unnecessary in many contexts (but sometimes it's unavoidably necessary!).
I'm not sure there's anything to be done here, except note that this is as designed until we have a better specialization story than we do right now. (TASTY may help. Miniboxing could also have helped, but we seem not to be going that way. Regular specialization causes too much bloat.)
Traversing of map with 128 key/value pairs can produce from 1.5K to 5K bytes for GC on JDK 8/11, while on GraalVM EE almost zero allocation is produced.