-
Notifications
You must be signed in to change notification settings - Fork 977
Add some compute Opcode benchmarks #9069
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
Conversation
Allow excludes option, e.g. -Pexcludes=TransientStorage,BlockHash Remove noisy logging during jmhJar task Signed-off-by: Simon Dudley <[email protected]>
| jmhVersion = '1.37' | ||
| fork = 3 | ||
| includes = _strListCmdArg('includes', ['']) | ||
| excludes = _strListCmdArg('excludes', []) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good addition!
build.gradle
Outdated
| ] | ||
| } | ||
| duplicateClassesStrategy = DuplicatesStrategy.WARN | ||
| duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it safe to do this? I can't see why would we end up with duplicate entries in the classpath for a clean project. I think it might be inheriting from our normal classpath? Some cleanup might be needed, maybe it's worth opening a ticket.
I tried adding includeTests = false which isolates jmh and test and got a bunch of missing dependencies, so it's not as easy as that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good callout. I played around with this a bit but doing this properly would be quite involved and involve the shadowJar plugin.
I'm not 100% sure it's safe to leave as EXCLUDE: seems like main issue could be if there were multiple implementations of service files (META-INF/services) that got excluded and so we used the wrong class at runtime. Seems unlikely to happen in the EVM code but benchmarks aren't limited to just that.
I think we can change to INCLUDE as it's the same behaviour as WARN but without the logs... we're not acting on the warnings, so don't think there's an issue with this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe @fab-10 would know more. I think even though it's repeated, by running ./gradlew :ethereum:core:dependencies --configuration jmhRuntimeClasspath I see that the duplicates are of the same version. Anyway, no need to block the PR for this, we can do either way - I agree it generates too much output.
ethereum/core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/BenchmarkHelper.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/BenchmarkHelper.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/BenchmarkHelper.java
Outdated
Show resolved
Hide resolved
ethereum/core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/BenchmarkHelper.java
Outdated
Show resolved
Hide resolved
.../core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/BinaryOperationBenchmark.java
Outdated
Show resolved
Hide resolved
.../core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/BinaryOperationBenchmark.java
Outdated
Show resolved
Hide resolved
| frame.pushStackItem(bPool[i]); | ||
| frame.pushStackItem(aPool[i]); | ||
|
|
||
| blackhole.consume(invoke(frame)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: thought compilation blackholes were enabled by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is but not 100% sure this isn't still needed?
e.g. this isn't used in place of a return at the end of the benchmark.
It might be "belts and braces" but I'd favour this explicit approach rather than accidentally eliminating code. Doesn't the overhead of this call get removed either way?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you will have overhead if you leave the call, though very small, from what I can infer from this article from Shipilev
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll leave it in for now since these benchmarks aren't tiny (yet!) but would like to confirm this one way or the other.
...eum/core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/ExpOperationBenchmark.java
Show resolved
Hide resolved
...core/src/jmh/java/org/hyperledger/besu/ethereum/vm/operations/TernaryOperationBenchmark.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine just a couple of comments to address
Signed-off-by: Luis Pinto <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
|
Cranked up the warmup and iterations to 5x 2 seconds to check this PR's warmup was sufficient (compared to run in desc)... Perhaps there's some reduction in a few error margins, but nothing signficant worth increasing warmup for IMO. |
Signed-off-by: Simon Dudley <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
Also think it should be enough at 1sec you can run 157010 iterations for the worst case which is EXP. It's well above the compilation tier thresholds |
Signed-off-by: Simon Dudley <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
Signed-off-by: Simon Dudley <[email protected]>
Adds an excludes option, e.g. -Pexcludes=TransientStorage,BlockHash and also includes option now works with comma-separated list, e.g. ./gradlew :ethereum:core:jmh -Pexcludes=Add,Mul,SMod,baseline -Pincludes=Mod,SDiv --rerun-tasks Remove noisy logging during jmhJar task Signed-off-by: Simon Dudley <[email protected]> * add SDiv benchmark Signed-off-by: Luis Pinto <[email protected]> --------- Signed-off-by: Simon Dudley <[email protected]> Signed-off-by: Luis Pinto <[email protected]> Co-authored-by: Luis Pinto <[email protected]>
| description = "Usage: gradle jmh -Pincludes=MyBench -PasyncProfiler=<libPath> -PasyncProfilerOptions=<options>\n" + | ||
| "\nRun JMH benchmarks in each of the projects. Allows for controlling JMH execution directly from the command line.\n" + | ||
| "\t-Pincludes=<includePattern>\tInclude pattern (regular expression) for benchmarks to be executed. Defaults to including all benchmarks.\n" + | ||
| "\t-Pexcludes=<excludePattern>\tComma-separated exclude pattern (regular expression) for benchmarks to not be executed. Defaults to including all benchmarks.\n" + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Adds an excludes option, e.g. -Pexcludes=TransientStorage,BlockHash and also includes option now works with comma-separated list, e.g. ./gradlew :ethereum:core:jmh -Pexcludes=Add,Mul,SMod,baseline -Pincludes=Mod,SDiv --rerun-tasks Remove noisy logging during jmhJar task Signed-off-by: Simon Dudley <[email protected]> * add SDiv benchmark Signed-off-by: Luis Pinto <[email protected]> --------- Signed-off-by: Simon Dudley <[email protected]> Signed-off-by: Luis Pinto <[email protected]> Co-authored-by: Luis Pinto <[email protected]>
Adds an excludes option, e.g. -Pexcludes=TransientStorage,BlockHash and also includes option now works with comma-separated list, e.g. ./gradlew :ethereum:core:jmh -Pexcludes=Add,Mul,SMod,baseline -Pincludes=Mod,SDiv --rerun-tasks Remove noisy logging during jmhJar task Signed-off-by: Simon Dudley <[email protected]> * add SDiv benchmark Signed-off-by: Luis Pinto <[email protected]> --------- Signed-off-by: Simon Dudley <[email protected]> Signed-off-by: Luis Pinto <[email protected]> Co-authored-by: Luis Pinto <[email protected]> Signed-off-by: jflo <[email protected]>
Adds an excludes option, e.g. -Pexcludes=TransientStorage,BlockHash and also includes option now works with comma-separated list, e.g. ./gradlew :ethereum:core:jmh -Pexcludes=Add,Mul,SMod,baseline -Pincludes=Mod,SDiv --rerun-tasks Remove noisy logging during jmhJar task Signed-off-by: Simon Dudley <[email protected]> * add SDiv benchmark Signed-off-by: Luis Pinto <[email protected]> --------- Signed-off-by: Simon Dudley <[email protected]> Signed-off-by: Luis Pinto <[email protected]> Co-authored-by: Luis Pinto <[email protected]> Signed-off-by: georgereuben <[email protected]>
Adds an excludes option, e.g. -Pexcludes=TransientStorage,BlockHash and also includes option now works with comma-separated list, e.g. ./gradlew :ethereum:core:jmh -Pexcludes=Add,Mul,SMod,baseline -Pincludes=Mod,SDiv --rerun-tasks Remove noisy logging during jmhJar task Signed-off-by: Simon Dudley <[email protected]> * add SDiv benchmark Signed-off-by: Luis Pinto <[email protected]> --------- Signed-off-by: Simon Dudley <[email protected]> Signed-off-by: Luis Pinto <[email protected]> Co-authored-by: Luis Pinto <[email protected]> Signed-off-by: georgereuben <[email protected]>
Heavily based on @daniellehrner's PR #8917
Allow excludes option, e.g. -Pexcludes=TransientStorage,BlockHash
Also gixes includes option to work with comma-separated list, e.g.
./gradlew :ethereum:core:jmh -Pexcludes=Add,Mul,SMod,baseline -Pincludes=Mod,SDiv --rerun-tasksRemove noisy logging during jmhJar task
m6a.2xlarge: