Integrated: 8256274: C2: Optimize copying of the shared type dictionary

Claes Redestad redestad at openjdk.java.net
Tue Nov 17 07:19:04 UTC 2020


On Thu, 12 Nov 2020 13:01:35 GMT, Claes Redestad <redestad at openjdk.org> wrote:

> - Remove unused (and subtly broken) Dict deep copy constructors
> - Add a fixed, deep copy constructor to Dict which also takes the arena to allocate the copy in
> - Use this new deep copy constructor in Type::Initialize instead of copying by iterating over the shared dict
> 
> This reduce the overhead of each C2 compilation by ~32k instructions[1], with a noticeable gain on targeted micros such as `trivialMath_repeat_c2`. Baseline:
> Benchmark                                      Mode  Cnt    Score   Error  Units
> SimpleRepeatCompilation.trivialMath_repeat_c2    ss   10  396.004 ± 3.061  ms/op
> Patch:
> Benchmark                                      Mode  Cnt    Score   Error  Units
> SimpleRepeatCompilation.trivialMath_repeat_c2    ss   10  354.639 ± 1.929  ms/op
> 
> (Each fork does 2000 repeated compilations, so the improvement is somewhere around 20us/compilation)
> 
> [1] when instrumenting with valgrind+callgrind

This pull request has now been integrated.

Changeset: 12285172
Author:    Claes Redestad <redestad at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/12285172
Stats:     187 lines in 3 files changed: 10 ins; 75 del; 102 mod

8256274: C2: Optimize copying of the shared type dictionary

Reviewed-by: neliasso, kvn

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

PR: https://git.openjdk.java.net/jdk/pull/1186


More information about the hotspot-compiler-dev mailing list