-
Enhancement
-
Resolution: Fixed
-
P4
-
10
-
b21
Core libraries have a number of usages of Unsafe.objectFieldOffset(Field) happen during startup, which means we spend some time loading ReflectionData for these classes.
I've explored adding a Unsafe.objectFieldOffset(Class, String) instead, and can validate that this approach has small, but measurable benefits to startup and total allocations:
http://cr.openjdk.java.net/~redestad/scratch/unsafe.offset.jdk
http://cr.openjdk.java.net/~redestad/scratch/unsafe.offset.hotspot
- Drops 9 classes from loading altogether on minimal startup tests
- Drops total instructions spent during startup by around 1.5-2.5M (0.5-1.5ms), scaling depending on how many of the changed classes are loaded (the speedup from not loading 9 classes is only a small part of this).
I've explored adding a Unsafe.objectFieldOffset(Class, String) instead, and can validate that this approach has small, but measurable benefits to startup and total allocations:
http://cr.openjdk.java.net/~redestad/scratch/unsafe.offset.jdk
http://cr.openjdk.java.net/~redestad/scratch/unsafe.offset.hotspot
- Drops 9 classes from loading altogether on minimal startup tests
- Drops total instructions spent during startup by around 1.5-2.5M (0.5-1.5ms), scaling depending on how many of the changed classes are loaded (the speedup from not loading 9 classes is only a small part of this).