On Mon, 16 Oct 2023 15:00:42 GMT, Shaojin Wen <d...@openjdk.org> wrote:

>> I submitted PR #15555 before, and there were too many changes. I split it 
>> into multiple PRs with small changes. This one is one of them.
>> 
>> this PR removed the duplicate code for getChars in 
>> BigDecimal#StringBuilderHelper, i also make performance faster.
>> Please review and don't hesitate to critique my approach and patch.
>
> Shaojin Wen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Use StringConcatFactory.makeConcatWithConstants

* use recipe ("\1.\1\1") branch : 
https://github.com/wenshao/jdk/tree/optim_decimal_to_string_x1_jfr


Running test 'micro:java.math.BigDecimals.testSmallToEngineeringString'
# JMH version: 1.37
# VM version: JDK 22-internal, OpenJDK 64-Bit Server VM, 
22-internal-adhoc.wenshao.jdk
# VM invoker: 
/Users/wenshao/Work/git/jdk/build/macosx-aarch64-server-release/images/jdk/bin/java
# VM options: 
-Djava.library.path=/Users/wenshao/git/jdk/build/macosx-aarch64-server-release/images/test/micro/native
 -XX:StartFlightRecording=filename=flight_dec.jfr
# Blackhole mode: compiler (auto-detected, use -Djmh.blackhole.autoDetect=false 
to disable)
# Warmup: 5 iterations, 1 s each
# Measurement: 5 iterations, 1 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: 
org.openjdk.bench.java.math.BigDecimals.testSmallToEngineeringString

# Run progress: 0.00% complete, ETA 00:00:30
# Fork: 1 of 3
[0.294s][info][jfr,startup] Started recording 1. No limit specified, using 
maxsize=250MB as default.
[0.294s][info][jfr,startup] 
[0.294s][info][jfr,startup] Use jcmd 90487 JFR.dump name=1 to copy recording 
data to file.
# Warmup Iteration   1: 14.387 ns/op
# Warmup Iteration   2: 13.387 ns/op
# Warmup Iteration   3: 12.925 ns/op
# Warmup Iteration   4: 12.941 ns/op
# Warmup Iteration   5: 12.873 ns/op
Iteration   1: 12.872 ns/op
Iteration   2: 12.893 ns/op
Iteration   3: 12.978 ns/op
Iteration   4: 12.834 ns/op
Iteration   5: 12.878 ns/op

# Run progress: 33.33% complete, ETA 00:00:22
# Fork: 2 of 3
[0.299s][info][jfr,startup] Started recording 1. No limit specified, using 
maxsize=250MB as default.
[0.299s][info][jfr,startup] 
[0.299s][info][jfr,startup] Use jcmd 5809 JFR.dump name=1 to copy recording 
data to file.
# Warmup Iteration   1: 19.515 ns/op
# Warmup Iteration   2: 17.993 ns/op
# Warmup Iteration   3: 17.739 ns/op
# Warmup Iteration   4: 17.687 ns/op
# Warmup Iteration   5: 17.720 ns/op
Iteration   1: 17.780 ns/op
Iteration   2: 17.526 ns/op
Iteration   3: 17.857 ns/op
Iteration   4: 17.667 ns/op
Iteration   5: 17.697 ns/op

# Run progress: 66.67% complete, ETA 00:00:11
# Fork: 3 of 3
[0.282s][info][jfr,startup] Started recording 1. No limit specified, using 
maxsize=250MB as default.
[0.282s][info][jfr,startup] 
[0.282s][info][jfr,startup] Use jcmd 20436 JFR.dump name=1 to copy recording 
data to file.
# Warmup Iteration   1: 14.122 ns/op
# Warmup Iteration   2: 12.530 ns/op
# Warmup Iteration   3: 12.472 ns/op
# Warmup Iteration   4: 12.479 ns/op
# Warmup Iteration   5: 12.501 ns/op
Iteration   1: 12.552 ns/op
Iteration   2: 12.583 ns/op
Iteration   3: 12.549 ns/op
Iteration   4: 12.487 ns/op
Iteration   5: 12.530 ns/op


Result "org.openjdk.bench.java.math.BigDecimals.testSmallToEngineeringString":
  14.379 ?(99.9%) 2.609 ns/op [Average]
  (min, avg, max) = (12.487, 14.379, 17.857), stdev = 2.440
  CI (99.9%): [11.770, 16.988] (assumes normal distribution)

[flight_dec.jfr.zip](https://github.com/openjdk/jdk/files/12974447/flight_dec.jfr.zip)

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

PR Comment: https://git.openjdk.org/jdk/pull/16006#issuecomment-1767505819

Reply via email to