-
Notifications
You must be signed in to change notification settings - Fork 131
Remove unsafe #184
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
Remove unsafe #184
Conversation
|
|
||
| // Determine reference size based on UseCompressedOops | ||
| // Default is true for heaps < 32GB on 64-bit JVMs | ||
| boolean compressedOops = getBooleanVmOption(hotSpotBean, "UseCompressedOops", true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the flag textual value an integer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I wrote tests. booleans give you true/false, and number ones give you numbers.
|
@dain before merging this can you release a snapshot so that we can benchmark this in Trino? |
JOL already did not work on records, and uses unsafe. Use HotSpotDiagnosticMXBean to query JVM options that determine object header sizes, use reflection to get field types, and handle alignment.
|
Sure, I published slice-2.5-20260202.012431-1. Please run the benchmarks soon, and if you seem a problem be specific. |
|
@dain testing here: trinodb/trino#28075 |
This PR:
Slicecopy to/fromprimitive[].Performance Testing (MemorySegment conversion):
Benchmarked Slice.getLongs()/setLongs() comparing Unsafe.copyMemory vs MemorySegment.copy on JDK 25:
primitive[]copy operations.