Integrated: 7944: Reduce allocations of Double during chunk loading

Richard Startin duke at openjdk.org
Wed Nov 9 22:54:36 UTC 2022


On Sat, 8 Oct 2022 17:30:35 GMT, Richard Startin <duke at openjdk.org> wrote:

> Using jmc-common as a library in a backend process we see high allocation rates of `Double` and have observed moderate performance improvements from this simple refactoring:
> * Use primitive `double` in `ImpreciseScaleFactor`
> * Use primitive `double` in `IScalarAffineTransformation.getOffset`
> * Push multiplication of a scale factor down to a new method `ScaleFactor.scale(long multiplier)`
> * Push `ScalarQuantity.in` down to `LongStored`/`DoubleStored` to avoid generalising over primitive types, when the `IQuantity` type can be varied instead.
> ---------
> ### Progress
> - [ ] Commit message must refer to an issue
> - [ ] Change must be properly reviewed (1 review required, with at least 1 [Committer](https://openjdk.org/bylaws#committer))
> 
> ### Reviewing
> <details><summary>Using <code>git</code></summary>
> 
> Checkout this PR locally: \
> `$ git fetch https://git.openjdk.org/jmc pull/436/head:pull/436` \
> `$ git checkout pull/436`
> 
> Update a local copy of the PR: \
> `$ git checkout pull/436` \
> `$ git pull https://git.openjdk.org/jmc pull/436/head`
> 
> </details>
> <details><summary>Using Skara CLI tools</summary>
> 
> Checkout this PR locally: \
> `$ git pr checkout 436`
> 
> View PR using the GUI difftool: \
> `$ git pr show -t 436`
> 
> </details>
> <details><summary>Using diff file</summary>
> 
> Download this PR as a diff file: \
> <a href="https://git.openjdk.org/jmc/pull/436.diff">https://git.openjdk.org/jmc/pull/436.diff</a>
> 
> </details>

This pull request has now been integrated.

Changeset: 761797e6
Author:    Richard Startin <richard.startin at datadoghq.com>
Committer: Henrik Dafgård <hdafgard at openjdk.org>
URL:       https://git.openjdk.org/jmc/commit/761797e6990e3588331250a41695b4ba978eba90
Stats:     103 lines in 10 files changed: 47 ins; 28 del; 28 mod

7944: Reduce allocations of Double during chunk loading

Reviewed-by: hdafgard

-------------

PR: https://git.openjdk.org/jmc/pull/436


More information about the jmc-dev mailing list