Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial build capability supporting benchmark creation.
Signed-off-by: Simeon H.K. fitch <fitch@astraea.io>
- Loading branch information
Showing
6 changed files
with
67 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# GeoTrellis Performance Benchmarking | ||
|
||
To run from project root directory: | ||
|
||
``` | ||
sbt bench/bench | ||
``` | ||
|
||
Results will be in `bench/target/jmh-results-<datestamp>.csv`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import java.text.SimpleDateFormat | ||
import java.util.Date | ||
|
||
import scala.util.matching.Regex | ||
|
||
enablePlugins(JmhPlugin) | ||
|
||
val jmhOutputFormat = settingKey[String]("Output format: {text|csv|scsv|json|latex}") | ||
jmhOutputFormat := "csv" | ||
|
||
val jmhFileRegex = settingKey[Regex]("Filename regular expression for selecting files to benchmark") | ||
jmhFileRegex := ".*Bench.*".r | ||
|
||
val jmhRun = Def.taskDyn { | ||
val rf = jmhOutputFormat.value | ||
def timestamp = new SimpleDateFormat("yyyyMMdd").format(new Date()) | ||
val rff = target.value / s"jmh-results-$timestamp.${jmhOutputFormat.value}" | ||
val pat = jmhFileRegex.value.toString | ||
|
||
val args = s" -rf $rf -rff $rff $pat" | ||
(run in Jmh).toTask(args) | ||
} | ||
|
||
val bench = taskKey[Unit]("Run JMH") | ||
bench := jmhRun.value | ||
|
||
|
24 changes: 24 additions & 0 deletions
24
bench/src/main/scala/geotrellis/spark/io/index/MergeQueueBench.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package geotrellis.spark.io.index | ||
|
||
|
||
import java.util.concurrent.TimeUnit | ||
import org.openjdk.jmh.annotations._ | ||
|
||
@BenchmarkMode(Array(Mode.AverageTime)) | ||
@OutputTimeUnit(TimeUnit.MICROSECONDS) | ||
@Warmup(iterations = 5) | ||
@Measurement(iterations = 10) | ||
@Fork(1) | ||
@Threads(1) | ||
@State(Scope.Thread) | ||
class MergeQueueBench { | ||
val queue = new MergeQueue() | ||
|
||
@Benchmark | ||
def mergeOrderedDense = { | ||
for(i ← -10000 to 10000) { | ||
queue += (i, i + 10) | ||
} | ||
queue | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version=0.13.15 | ||
sbt.version=0.13.16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters