Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JMH Perf Tests #993

Merged
merged 3 commits into from
Mar 27, 2014
Merged

Conversation

benjchristensen
Copy link
Member

  1. Migrate all previous tests into rx.archive until we have matured with JMH
  2. JMH config in gradle
  3. Start of benchmarking with JMH for baseline, map and serialize

To Run

Inside ./rxjava-core/ invoke ../gradlew benchmarks

Or from base invoke ./gradlew benchmarks and it will scan each sub-module for benchmarks and then only find them in rxjava-core.

Output

Result : 72.204 ±(99.9%) 7.524 ns/op
  Statistics: (min, avg, max) = (69.221, 72.204, 74.048), stdev = 1.954
  Confidence interval (99.9%): [64.680, 79.729]


Benchmark                                                          (size)   Mode   Samples         Mean   Mean error    Units
r.jmh.Baseline.forLoopInvokingFunction                               1024   avgt         5     3230.689      486.080    ns/op
r.jmh.Baseline.forLoopInvokingFunction                            1048576   avgt         5  3394679.521   148858.373    ns/op
r.operators.OperatorMapPerf.mapIdentityFunction                         1   avgt         5       91.338        8.504    ns/op
r.operators.OperatorMapPerf.mapIdentityFunction                      1024   avgt         5     5626.727     1209.108    ns/op
r.operators.OperatorMapPerf.mapIdentityFunction                   1048576   avgt         5  6268747.085   258008.983    ns/op
r.operators.OperatorSerializePerf.noSerializationSingleThreaded      1024   avgt         5       42.198        0.791    ns/op
r.operators.OperatorSerializePerf.noSerializationSingleThreaded   1048576   avgt         5       45.935        0.911    ns/op
r.operators.OperatorSerializePerf.serializedSingleStream             1024   avgt         5       69.410       10.499    ns/op
r.operators.OperatorSerializePerf.serializedSingleStream          1048576   avgt         5       72.305       11.450    ns/op
r.operators.OperatorSerializePerf.synchronizedSingleStream           1024   avgt         5       72.238        7.233    ns/op
r.operators.OperatorSerializePerf.synchronizedSingleStream        1048576   avgt         5       72.204        7.524    ns/op


- this allows running benchmarks
- config is hardcoded right now
- wasn't able to get uberjar/shadowjar functionality working (ReactiveX#963 (comment))
@benjchristensen
Copy link
Member Author

Thank you @gvsmirnov for help getting this running. Please don't hesitate to provide suggestions and tips.

The things I'm still trying to figure out are:

  1. How to measure object allocation.
  2. Passing arguments into the ./gradlew benchmarks command as right now everything is hardcoded inside build.gradle
  3. How to generate an UberJar/ShadowJar with all necessary code so the testing can be done via an executable jar as JMH typically done.

benjchristensen added a commit that referenced this pull request Mar 27, 2014
@benjchristensen benjchristensen merged commit 4d9e3e6 into ReactiveX:master Mar 27, 2014
@benjchristensen benjchristensen deleted the perf-tests branch March 27, 2014 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant