RFR: 8342806: Desugar capturing lambda in StringNameTable [v2]

Claes Redestad redestad at openjdk.org
Tue Oct 22 10:14:05 UTC 2024


> - Desugar `computeIfAbsent` to `get` & `put` to avoid a capturing lambda. Since the map is a non-synchronized `HashMap` this is just as non-thread-safe as before.
> - Salvage the microbenchmark added as a JBS comment to https://bugs.openjdk.org/browse/JDK-8268622 
> - Microbenchmark show a modest reduction in allocations for tests stressing `StringNameTable` (Macbook M1):
> 
> 
> Name                  Cnt         Base         Error          Test         Error   Unit  Change
> testInternStringTable  10       55,731 ±       3,701        51,083 ±       2,062  ms/op   1,09x (p = 0,000*)
>   :gc.alloc.rate.norm     54705366,956 ±  375197,844  53936224,624 ± 1421298,600   B/op   0,99x (p = 0,031 )
> testSharedTable        10       47,997 ±       5,802        48,022 ±       4,968  ms/op   1,00x (p = 0,988 )
>   :gc.alloc.rate.norm     56562680,368 ± 1535117,433  53403645,438 ±  218526,779   B/op   0,94x (p = 0,000*)
> testStringTable        10       45,933 ±       2,542        44,094 ±       1,360  ms/op   1,04x (p = 0,009*)
>   :gc.alloc.rate.norm     56244541,359 ± 1019940,919  53226602,956 ±  510018,314   B/op   0,95x (p = 0,000*)
> testUnsharedTable      10       60,474 ±       1,912        59,068 ±       1,038  ms/op   1,02x (p = 0,008*)
>   :gc.alloc.rate.norm     66970079,820 ± 1402704,512  67285851,746 ±  883540,307   B/op   1,00x (p = 0,377 )
>   * = significant

Claes Redestad has updated the pull request incrementally with one additional commit since the last revision:

  de-this

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/21631/files
  - new: https://git.openjdk.org/jdk/pull/21631/files/22c50339..3f1fe191

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=21631&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=21631&range=00-01

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/21631.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21631/head:pull/21631

PR: https://git.openjdk.org/jdk/pull/21631


More information about the compiler-dev mailing list