Using value classes to optimize erased generics
Diego Antonio Rosario Palomino
diegorosario2013 at gmail.com
Thu Mar 27 16:59:02 UTC 2025
Hi all,
I’ve been thinking about whether we can optimize erased generics using only
the already-finalized features of Project Valhalla—specifically, value
classes.
Even though generics are still erased, if the erased value is a value
class, maybe the JVM could still store it without indirection. This
wouldn’t require full specialization like the Parametric JVM, but could
still improve performance in common cases.
It’s similar in spirit to this issue in the Sixten language:
https://github.com/ollef/sixten/issues/149
Also—could someone please point me to current resources or documentation
about the Parametric JVM? I’d like to share them with some folks working on
Scala and Idris2 backends to explore whether targeting it is practical.
Thanks,
Diego Antonio Rosario Palomino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/valhalla-spec-observers/attachments/20250327/09a5a44f/attachment-0001.htm>
More information about the valhalla-spec-observers
mailing list