Skip to content

Conversation

tuchida
Copy link
Contributor

@tuchida tuchida commented Mar 26, 2021

#837 (comment)
When it don't need to convert to Object, it don't.

before

# JMH version: 1.27
# VM version: JDK 1.8.0_282, OpenJDK 64-Bit Server VM, 25.282-b08
# VM invoker: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
# VM options: -Dfile.encoding=UTF-8 -Duser.country=JP -Duser.language=ja -Duser.variant
# JMH blackhole mode: full blackhole + dont-inline hint
# Warmup: 5 iterations, 10 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.mozilla.javascript.benchmarks.SunSpiderBenchmark.bitopsNsieveBits

# Run progress: 26.92% complete, ETA 00:31:47
# Fork: 1 of 1
# Warmup Iteration   1: 19254.470 us/op
# Warmup Iteration   2: 18990.886 us/op
# Warmup Iteration   3: 19167.778 us/op
# Warmup Iteration   4: 19168.355 us/op
# Warmup Iteration   5: 19200.321 us/op
Iteration   1: 19247.105 us/op
Iteration   2: 19062.072 us/op
Iteration   3: 19205.020 us/op
Iteration   4: 19181.690 us/op
Iteration   5: 19168.668 us/op


Result "org.mozilla.javascript.benchmarks.SunSpiderBenchmark.bitopsNsieveBits":
  19172.911 ±(99.9%) 264.802 us/op [Average]
  (min, avg, max) = (19062.072, 19172.911, 19247.105), stdev = 68.768
  CI (99.9%): [18908.110, 19437.713] (assumes normal distribution)

after

# JMH version: 1.27
# VM version: JDK 1.8.0_282, OpenJDK 64-Bit Server VM, 25.282-b08
# VM invoker: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
# VM options: -Dfile.encoding=UTF-8 -Duser.country=JP -Duser.language=ja -Duser.variant
# JMH blackhole mode: full blackhole + dont-inline hint
# Warmup: 5 iterations, 10 s each
# Measurement: 5 iterations, 10 s each
# Timeout: 10 min per iteration
# Threads: 1 thread, will synchronize iterations
# Benchmark mode: Average time, time/op
# Benchmark: org.mozilla.javascript.benchmarks.SunSpiderBenchmark.bitopsNsieveBits

# Run progress: 26.92% complete, ETA 00:31:47
# Fork: 1 of 1
# Warmup Iteration   1: 10719.027 us/op
# Warmup Iteration   2: 10509.302 us/op
# Warmup Iteration   3: 10269.435 us/op
# Warmup Iteration   4: 10455.276 us/op
# Warmup Iteration   5: 10424.450 us/op
Iteration   1: 10484.017 us/op
Iteration   2: 10447.017 us/op
Iteration   3: 10589.642 us/op
Iteration   4: 10463.092 us/op
Iteration   5: 10521.481 us/op


Result "org.mozilla.javascript.benchmarks.SunSpiderBenchmark.bitopsNsieveBits":
  10501.050 ±(99.9%) 218.814 us/op [Average]
  (min, avg, max) = (10447.017, 10501.050, 10589.642), stdev = 56.825
  CI (99.9%): [10282.236, 10719.864] (assumes normal distribution)

@gbrail
Copy link
Collaborator

gbrail commented Apr 3, 2021

This is an interesting optimization. Thanks!

@gbrail gbrail merged commit 630b3c7 into mozilla:master Apr 3, 2021
@tuchida tuchida mentioned this pull request Apr 23, 2021
@tuchida tuchida deleted the improve-bitnot2 branch May 27, 2021 08:14
@p-bakker p-bakker added the Performance Issues related to the performance of the Rhino engine label Oct 13, 2021
@p-bakker p-bakker added this to the Release 1.7.14 milestone Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Performance Issues related to the performance of the Rhino engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants