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

Reducing the usage of Jmh Invocation level on setup #6459

Merged
merged 2 commits into from Oct 15, 2018

Conversation

DiegoEliasCosta
Copy link
Contributor

Motivation:

We are conducting a scientific study to investigate bad practices/anti-patterns on creating micro-benchmarks using JMH, and we found an instance of harmfull usage of Invocation level in LoadStatusBenchmark.

The usage of Invocation level for JMH fixture methods (setup/teardown) inccurs in a significant impact in
in the benchmark time (see JMH Documentation).

When benchmark and setup/teardown is too small (less than a milisecond) the Invocation level might saturate the system with timestamp requests and iteration synchronizations which introduce artificial latency, throughput, and scalability bottlenecks.

Modification:
I moved the code that doesn't need to be created on every invocation into a setup with Trial level.

Results
In all our tests, benchmarks run faster now (from 30-50%), without the high JMH Overhead.
I am reporting the result of 5 full executions with default parameters (iterations, forks, warmups, etc..)

druid-fixed-antipatters-invo.zip

Environment:
Tests run on a Computational server with CPU: E5-1660-3.3GHZ (6 cores + HT), 64 GB RAM.

@QiuMM
Copy link
Member

QiuMM commented Oct 12, 2018

Nice catch!

Copy link
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think this benchmark can just be deleted, it was added to check a performance bugfix, but isn't really testing anything specific to druid, rather just comparing the performance of removeAll vs looping remove. It was useful to prove the changes were the correct changes to make in that PR, but probably doesn't need to remain in the codebase.

Would you mind updating this PR to just delete this benchmark? Thanks for being on the lookout for these issues though, it is appreciated! 👍

@jon-wei
Copy link
Contributor

jon-wei commented Oct 12, 2018

@DiegoEliasCosta Thanks for taking the time to look into this!

I'll second the suggestion from @clintropolis, I think this benchmark should really be removed.

@DiegoEliasCosta
Copy link
Contributor Author

Okay then! I just removed LoadStatusBenchmark class from the codebase.

Copy link
Member

@clintropolis clintropolis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM 👍

@b-slim b-slim merged commit d5ccd58 into apache:master Oct 15, 2018
@jon-wei jon-wei added this to the 0.14.0 milestone Feb 20, 2019
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

5 participants