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-based benchmark framework for contributors #5061
Conversation
presumably the integrate-ide failure is scala/scala-dev#104 rather than anything specific to this PR |
Great stuff. I had toyed with this idea in https://github.com/retronym/scala-jmh-suite, which includes some plumbing to enable collection of Java Flight Recorder profiles of benchmarks. |
Thanks. Thanks for the URL. I'll need to track memory usage soon. I also want to build my Gnuplot graphs automatically. More to come after this PR. |
@retronym, I'm going with JOL, since it gives me easy access to memory usage from the teardown code. Can't figure how I'd do that with Flight Recorder. |
The more tools in the box, the better. I'm mostly after a convienient way to turn on Flight recorder when analysing benchmarks manually. |
/nothingtoseehere -- The failure is due to scala/scala-dev#104, not this PR. |
|
||
## running a benchmark | ||
|
||
The benchmarks require first building Scala into `../../build/pack`, using Ant. |
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.
Does it matter whether it's Ant or SBT?
I've added the suffix to tell the CI to only build the last commit, to help in load balancing. Let's do a rebuild when the other commits are done. |
/rebuild |
I removed the suffix that tells the CI to only build the last commit and then |
cfe16d4
to
486821b
Compare
@performantdata - I'm snowed under with commitments but I'll try to get to it sometime this weekend (probably Sunday afternoon). |
import java.io.OutputStreamWriter | ||
import java.io.PrintWriter | ||
import scala.collection.JavaConversions | ||
import scala.language.existentials |
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.
This import is kind of lost here, which is contrary to the point of requiring the import in the first place. Can you move it to the top?
Getting close! I think there's just one real bug--or maybe it's just unclear, in which case you should leave a comment explaining why the right method is being benchmarked. The rest is just random style stuff. The last step will be to squash the commits into one; there doesn't seem to be any particular value to leaving them separate is there? (You might want to leave a branch with them separate in your repository, but it seems unnecessary for the main one.) |
So, it's not a bug. I can address the style stuff in a subsequent commit in the PRs that I'll soon be benchmarking but haven't opened yet. Otherwise...when would you finish review? |
Anyway, the tests look technically correct. There doesn't seem to be any reason to keep the separate commits, so you should squash them for the PR. The style could use a little improvement, and I'm a little wary of a promissory note instead of an actual fix (at least for most of them--the single |
And thank you for writing a JMH harness for testing library performance! It's long overdue in my opinion. |
It almost does, but not completely, which is why I avoided the normal phrase. It would look good if the last few issues were fixed; as it is it's technically sound so could be merged anyway. |
I'm going to merge this one. Thanks for this effort, @performantdata. I think the commit history is clean enough to merge without squashing in this instance. |
Uh...OK, thanks. I'm currently working on the fixes that Rex asked for, and adding Thanks, Rex! |
we don't normally release-note contributor-facing things, but perhaps we really want to draw attention to this? not sure, untag if you disagree |
@performantdata @szeiger well I know quite some time has passed, but I'm wondering if you, or anyone else watching the repo, has anything that does this. even if it's not fully automatic, any sort of instructions I could follow. I'd love to be able to generate nice graphs like Stefan did over at #8534 |
ah, @retronym has directed me towards https://github.com/lightbend/benchdb I'll take it for a spin. (and perhaps if I'm feeling especially virtuous, I will add something about it to the benchmarking readme...) |
Turns
test/benchmarks
into an SBT project that uses SBT-JMH.This is in follow-up to my plans mentioned on scala-internals.