Skip to content

Conversation

@mxsm
Copy link
Member

@mxsm mxsm commented Nov 24, 2022

Make sure set the target branch to develop

What is the purpose of the change

close #5584

Brief changelog

  • Use non-synchronized getTimeZone in CLusterSendMsgRTCommand#getCurTime

Verifying this change

XXXX

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Format the pull request title like [ISSUE #123] Fix UnknownException when host config not exist. Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in test module.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@mxsm
Copy link
Member Author

mxsm commented Nov 24, 2022

Before

# JMH version: 1.35
# VM version: JDK 1.8.0_342, OpenJDK 64-Bit Server VM, 25.342-b07
# VM invoker: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
# VM options: <none>
# Blackhole mode: full + dont-inline hint (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 2 s each
# Measurement: 3 iterations, 4 s each
# Timeout: 10 min per iteration
# Threads: 8 threads, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: com.github.mxsm.TimeZoneBenchmark.timeZoneSynchronized

# Run progress: 0.00% complete, ETA 00:00:18
# Fork: 1 of 1
# Warmup Iteration   1: 3355510.052 ops/s
# Warmup Iteration   2: 3679662.938 ops/s
# Warmup Iteration   3: 3838317.105 ops/s
Iteration   1: 3850009.830 ops/s
                 ·stack: <delayed till summary>

Iteration   2: 3777740.945 ops/s
                 ·stack: <delayed till summary>

Iteration   3: 3705109.916 ops/s
                 ·stack: <delayed till summary>



Result "com.github.mxsm.TimeZoneBenchmark.timeZoneSynchronized":
  3777620.230 ±(99.9%) 1321758.302 ops/s [Average]
  (min, avg, max) = (3705109.916, 3777620.230, 3850009.830), stdev = 72450.033
  CI (99.9%): [2455861.929, 5099378.532] (assumes normal distribution)

Secondary result "com.github.mxsm.TimeZoneBenchmark.timeZoneSynchronized:·stack":
Stack profiler:

....[Thread state distributions]....................................................................
 85.9%         BLOCKED
 13.8%         RUNNABLE
  0.2%         WAITING

....[Thread state: BLOCKED].........................................................................
 85.9% 100.0% java.util.TimeZone.getTimeZone

....[Thread state: RUNNABLE]........................................................................
 12.4%  89.3% java.util.TimeZone.getTimeZone
  0.7%   5.0% java.util.GregorianCalendar.computeFields
  0.2%   1.4% java.lang.Object.clone
  0.1%   0.6% java.util.Arrays.copyOf
  0.1%   0.5% java.text.SimpleDateFormat.format
  0.1%   0.5% sun.util.calendar.ZoneInfoFile.toCustomID
  0.1%   0.4% sun.util.calendar.ZoneInfo.getTransitionIndex
  0.1%   0.4% java.text.SimpleDateFormat.initialize
  0.0%   0.2% java.text.DateFormatSymbols.<init>
  0.0%   0.2% java.text.SimpleDateFormat.subFormat
  0.2%   1.5% <other>

....[Thread state: WAITING].........................................................................
  0.2% 100.0% sun.misc.Unsafe.park



# Run complete. Total time: 00:00:18

REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial
experiments, perform baseline and negative tests that provide experimental control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts.
Do not assume the numbers tell you what you want them to tell.

Benchmark                                       Mode  Cnt        Score         Error  Units
TimeZoneBenchmark.timeZoneSynchronized         thrpt    3  3777620.230 ± 1321758.302  ops/s
TimeZoneBenchmark.timeZoneSynchronized:·stack  thrpt               NaN                  ---

@mxsm
Copy link
Member Author

mxsm commented Nov 24, 2022

After

# JMH version: 1.35
# VM version: JDK 1.8.0_342, OpenJDK 64-Bit Server VM, 25.342-b07
# VM invoker: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
# VM options: <none>
# Blackhole mode: full + dont-inline hint (auto-detected, use -Djmh.blackhole.autoDetect=false to disable)
# Warmup: 3 iterations, 2 s each
# Measurement: 3 iterations, 4 s each
# Timeout: 10 min per iteration
# Threads: 8 threads, will synchronize iterations
# Benchmark mode: Throughput, ops/time
# Benchmark: com.github.mxsm.TimeZoneBenchmark.timeZoneNonSynchronized

# Run progress: 0.00% complete, ETA 00:00:18
# Fork: 1 of 1
# Warmup Iteration   1: 5399393.834 ops/s
# Warmup Iteration   2: 6425872.682 ops/s
# Warmup Iteration   3: 7142158.397 ops/s
Iteration   1: 7161349.525 ops/s
                 ·stack: <delayed till summary>

Iteration   2: 7133167.489 ops/s
                 ·stack: <delayed till summary>

Iteration   3: 7089499.965 ops/s
                 ·stack: <delayed till summary>



Result "com.github.mxsm.TimeZoneBenchmark.timeZoneNonSynchronized":
  7128005.660 ±(99.9%) 660456.318 ops/s [Average]
  (min, avg, max) = (7089499.965, 7128005.660, 7161349.525), stdev = 36201.839
  CI (99.9%): [6467549.342, 7788461.978] (assumes normal distribution)

Secondary result "com.github.mxsm.TimeZoneBenchmark.timeZoneNonSynchronized:·stack":
Stack profiler:

....[Thread state distributions]....................................................................
 99.7%         RUNNABLE
  0.3%         WAITING

....[Thread state: RUNNABLE]........................................................................
 22.3%  22.4% sun.util.calendar.ZoneInfo.getTransitionIndex
 14.3%  14.4% java.text.SimpleDateFormat.format
 12.3%  12.3% java.text.DateFormatSymbols.<init>
 10.2%  10.2% java.lang.StringBuilder.getChars
  9.3%   9.3% java.util.GregorianCalendar.computeFields
  7.8%   7.8% java.text.SimpleDateFormat.subFormat
  6.4%   6.4% java.time.ZoneId.systemDefault
  6.4%   6.4% java.util.GregorianCalendar.computeTime
  5.0%   5.0% java.text.SimpleDateFormat.initializeDefaultCentury
  1.3%   1.3% org.openjdk.jmh.infra.Blackhole.consume
  4.4%   4.4% <other>

....[Thread state: WAITING].........................................................................
  0.3% 100.0% sun.misc.Unsafe.park



# Run complete. Total time: 00:00:18

REMEMBER: The numbers below are just data. To gain reusable insights, you need to follow up on
why the numbers are the way they are. Use profilers (see -prof, -lprof), design factorial
experiments, perform baseline and negative tests that provide experimental control, make sure
the benchmarking environment is safe on JVM/OS/HW level, ask for reviews from the domain experts.
Do not assume the numbers tell you what you want them to tell.

Benchmark                                          Mode  Cnt        Score        Error  Units
TimeZoneBenchmark.timeZoneNonSynchronized         thrpt    3  7128005.660 ± 660456.318  ops/s
TimeZoneBenchmark.timeZoneNonSynchronized:·stack  thrpt               NaN                 ---

@github-actions
Copy link

This PR is stale because it has been open for 365 days with no activity. It will be closed in 3 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this PR.

@github-actions github-actions bot added the stale label Nov 26, 2023
@github-actions
Copy link

This PR was closed because it has been inactive for 3 days since being marked as stale.

@github-actions github-actions bot closed this Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use non-synchronized getTimeZone in CLusterSendMsgRTCommand#getCurTime

2 participants