Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s.c.i.IntMap and s.c.m.LongMap do lot of allocations during traversing by foreach/foreachKey/iterator #11084

Open
plokhotnyuk opened this issue Aug 16, 2018 · 1 comment

Comments

@plokhotnyuk
Copy link

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.

@plokhotnyuk plokhotnyuk changed the title s.c.i.IntMap and s.c.m.LongMap do lot allocation during traversing by foreach/foreachKey/iterator s.c.i.IntMap and s.c.m.LongMap do lot of allocations during traversing by foreach/foreachKey/iterator Aug 18, 2018
@Ichoran
Copy link

Ichoran commented Aug 18, 2018

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants