DFP icon indicating copy to clipboard operation
DFP copied to clipboard

Test pefrormance of Decimal64 class with Valhalla

Open alexei-osipov opened this issue 1 year ago • 1 comments

Decimal64 java class can become a "value class" in Valhalla.

We should try to test Decimal64 as value class:

  • how well it works,
  • ensure that there are no allocations on heap,
  • compare it's performance with non-valhalla JRE with Java Agent enabled.

alexei-osipov avatar Oct 11 '24 13:10 alexei-osipov

Status update: current Valhalla (build 26-jep401ea2+1-1 (2025/10/10)) supports flattening of arrays only if entire value class body fits into 64 bits. A 64-bit long value with 1 null-indicator bit would require at least 65 bits. So our Decimal64 class can't be flattened with current Valhalla implementation.

However it's still should be profitable as regular object fields and intermediate code variables can directly benefit from making Decimal64 a value class.

alexei-osipov avatar Nov 14 '25 22:11 alexei-osipov