Comments (10)
Thanks for the ping, bumped the dependency: 5ecebe5 (0.1.8
)
Should be online already.
from sbt-jmh.
Wow, that was fast!
Many thanks!
from sbt-jmh.
no time to lose! :-)
from sbt-jmh.
For some reason the JMH dependency in 0.1.8 is still onto 1.3.1:
[info] downloading https://repo.scala-sbt.org/scalasbt/sbt-plugin-releases/pl.project13.scala/sbt-jmh/scala_2.10/sbt_0.13/0.1.8/jars/sbt-jmh.jar ...
[info] [SUCCESSFUL ] pl.project13.scala#sbt-jmh;0.1.8!sbt-jmh.jar (2245ms)
[info] Done updating.
[info] Set current project to root (in build file:/.../)
root > p benchmark
[info] Set current project to benchmark (in build file:/.../)
benchmark > show libraryDependencies
[info] List(org.scala-lang:scala-library:2.11.5, org.openjdk.jmh:jmh-core:1.3.1, org.openjdk.jmh:jmh-generator-bytecode:1.3.1, org.openjdk.jmh:jmh-generator-reflection:1.3.1)
benchmark >
Maybe the JAR somehow didn't get rebuilt properly for the latest release?
from sbt-jmh.
Hm... thanks for the info, I'll look into that today evening
from sbt-jmh.
Thanks, Konrad!
Meanwhile JMH 1.5 has been released.
Maybe it's even possible to upgrade to that right away.
from sbt-jmh.
Had a silly mistake in the 1.8 release: c20646b#diff-656d44ed3ab355d919402897bec8a9bdL44
Now fixed and released 0.1.9
with 1.5
support. Happy hakking!
from sbt-jmh.
Great! Thanks!
One more (unrelated) question that I am just about to look into:
Do you know the best way to access the benchmark results programmatically?
It seems I need to get a public static main
method into the benchmark class, which is not as easy as it should be. I'm thinking a parent class written in Java which simply calls out to a Scala object could do the trick, but I might be missing something.
from sbt-jmh.
Good and bad news for that one.
Good comes first. You can either just write a main class that invokes the runner explicitly, and then gets the results from a run()
. You also can give a custom output formatter, as shown below.
package org.openjdk.jmh
import java.util
import org.openjdk.jmh._
import org.openjdk.jmh.infra.{IterationParams, BenchmarkParams}
import org.openjdk.jmh.results.{BenchmarkResult, RunResult, IterationResult}
import org.openjdk.jmh.runner.Runner
import org.openjdk.jmh.runner.format.OutputFormat
import org.openjdk.jmh.runner.options.CommandLineOptions
object RunnerApp extends App {
import collection.JavaConversions._
val opts = new CommandLineOptions(args: _*)
val formatter = new OutputFormat {override def iteration(benchmarkParams: BenchmarkParams, iterationParams: IterationParams, i: Int): Unit = ???
override def endBenchmark(benchmarkResult: BenchmarkResult): Unit = ???
override def endRun(collection: java.util.Collection[RunResult]): Unit = ???
override def flush(): Unit = ???
override def write(i: Int): Unit = ???
override def write(bytes: Array[Byte]): Unit = ???
override def startBenchmark(benchmarkParams: BenchmarkParams): Unit = ???
override def startRun(): Unit = ???
override def close(): Unit = ???
override def println(s: String): Unit = ???
override def verbosePrintln(s: String): Unit = ???
override def iterationResult(benchmarkParams: BenchmarkParams, iterationParams: IterationParams, i: Int, iterationResult: IterationResult): Unit = ???
override def print(s: String): Unit = ???
}
// val runner = new Runner(opts, formatter)
val runner = new Runner(opts)
val res = runner.run()
res.foreach { r ⇒
println("r.getAggregatedResult = " + r.getAggregatedResult)
}
}
Now bad news: It won't work "just like that"... Currently we'd get class not founds because of the generated classes not being on the classpath of when you runMain
something. I think this should be solvable by adding ./target/scala-2.10/classes/
to the classpath for runMain
hm. I'll create a ticket and look into it.
Other hints: depends what you're doing (getting programatic access becomes a ticket now ;-)),
maybe exporting to csv or json would be useful? That's just an option and would work now, the available output formats are: [info] Available formats: text, csv, scsv, json, latex
.
from sbt-jmh.
Great. Thanks for the info. I'll work something out and let you know...
from sbt-jmh.
Related Issues (20)
- Add recommended jvm options in async profiler HOT 2
- missing tag for 0.3.4 on GitHub HOT 1
- Cannot run JMH benchmarks with async-profiler for versions 0.3.5 and 0.3.6 HOT 1
- Version 0.3.5 JFR profile java.lang.UnsupportedClassVersionError on Java 8 HOT 3
- Tab completion for jmh parameters
- CI broken: unable to install oraclejdk8 HOT 4
- Request for feature: Cross-Versions benchmarking HOT 2
- Canceling execution does not work on Windows
- Error when trying to use Flight Recorder HOT 5
- Scala 2.13 support is missing ? HOT 1
- Benchmark compilation fails if java.sql.ResultSet is used HOT 4
- Is it possible to set `bspEnable := false` by default? HOT 1
- publish to maven central instead of bintray HOT 5
- jmh:run caused Unable to find the resource: /META-INF/BenchmarkList in multiple projects
- Specifying javaHome per configuration
- Log4j Dependencies not being passed to the Benchmark
- `Test / skip := true` leads to `java.lang.IllegalArgumentException: Benchmark does not match a class`
- Upgrade project/build.properties to use SBT 1.9.0 HOT 2
- How to use async-profiler with multiple options HOT 6
- Forking JMH may fail on Windows with "CreateProcess error=206, The filename or extension is too long" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sbt-jmh.