minor_version; u2 major_version; u2 constant_pool_count; cp_info constant_pool[constant_pool_count-1]; u2 access_flags; u2 this_class; u2 super_class; u2 interfaces_count; u2 interfaces[interfaces_count]; u2 fields_count; field_info fields[fields_count]; u2 methods_count; method_info methods[methods_count]; u2 attributes count;
Point point = new Point(x, y); storePoint(point); } // inlining public record(int x, int y) { Point point = new Point(x, y); events.store("Added point", point.x, point.y); } // scalar replacement public record(int x, int y) { events.store("Added point", x, y); }
result = new ArrayList<>(); synchronized(result) { fillResult(users); } } //turns into public void process(List<User> users) { List<User> result = new ArrayList<>(); fillResult(users); }
RUNNABLE at io.codearte.BlockBuilder.startBlock(BlockBuilder.groovy:21) at io.codearte.Generator.process(Generator.java:318) at io.codearte.ImportantApp.do(ImportantApp.java:64) at sun.reflect.NativeMethodImpl.invoke(NativeMethodImpl.java:18) at sun.reflect.NativeMethodImpl.invoke(NativeMethodImpl.java:62) at java.lang.reflect.Method.invoke(Method.java:497)
DESCRIPTION VALUE 0 12 (object header) N/A 12 4 int Product.id N/A 16 4 String Product.name N/A 20 4 (loss due to the next object alignment) Instance size: 24 bytes (estimated, the sample instance is not available) Space losses: 0 bytes internal + 4 bytes external = 4 bytes total
James Gough The Well-Grounded Java Developer - Benjamin J. Evans, Martijn Verburg Java Performance - Charlie Hunt, Binu John Java Performance: The De nitive Guide - Scott Oaks