Elektrine lite

← Feed

@cayhorstmann@foojay.social

2026-08-08 05:14 UTC

1/2 Now that Valhalla is in mainline (https://jdk.java.net/28/), let's see what it can do: $ cat Ids.java value record Id(int value) {} public class Ids { void main() throws Exception { var ids = new Id[100_000_000]; for (int i = 0; i < ids.length; i++) ids[i] = new Id(i); IO.println(ids); Thread.sleep(10000); } } $ javac --enable-preview --source 28 Ids.java $ java --enable-preview Ids && (jcmd Ids GC.class_histogram | head)

Replies (0)

No replies.