-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c58a40d
commit 1c338f1
Showing
2 changed files
with
52 additions
and
0 deletions.
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,47 @@ | ||
#!/bin/zsh | ||
|
||
# Usage: | ||
# `./benchmark.zsh` ......... benchmark run-time performance and memory footprint | ||
# `./benchmark.zsh time` .... benchmark run-time performance only | ||
# `./benchmark.zsh space` ... benchmark memory footprint only | ||
|
||
set -euo pipefail | ||
|
||
benchmark_selector=${1:-} | ||
|
||
export PARAM_SIZE="8,2048,1048576" | ||
export PARAM_VALUE_FACTORY="VF_CAPSULE,VF_SCALA,VF_CLOJURE" | ||
export MEMORY_MEASURER_AGENT="$(./gradlew memoryMeasurerLocation --quiet)" | ||
|
||
export JMH_JAR=`find $(pwd) -name "*-jmh.jar"` | ||
|
||
#### | ||
# MEASURE RUNTIMES | ||
################################## | ||
|
||
if [[ -z "$benchmark_selector" || "$benchmark_selector" == "time" ]]; then | ||
java -jar $JMH_JAR \ | ||
"JmhSetBenchmarks.time(Lookup$|Insert$|Remove$|Iteration|EqualsWorstCase)$" \ | ||
-f 1 -i 5 -wi 5 \ | ||
-p producer=PURE_INTEGER \ | ||
-p size=$PARAM_SIZE \ | ||
-p valueFactoryFactory=$PARAM_VALUE_FACTORY \ | ||
-rf text -rff log-jmh-persistent-collections-time.txt | ||
|
||
# further benchmarks: SubsetOf|(Union|Subtract|Intersect)RealDuplicate | ||
fi | ||
|
||
### | ||
# MEASURE MEMORY FOOTPRINT | ||
################################# | ||
|
||
if [[ -z "$benchmark_selector" || "$benchmark_selector" == "space" ]]; then | ||
java -javaagent:$MEMORY_MEASURER_AGENT -jar $JMH_JAR \ | ||
"JmhSetBenchmarks.footprint$" \ | ||
-f 1 -bm ss \ | ||
-p producer=PURE_INTEGER \ | ||
-p size=$PARAM_SIZE \ | ||
-p valueFactoryFactory=$PARAM_VALUE_FACTORY \ | ||
-prof io.usethesource.capsule.jmh.profiler.MemoryFootprintProfiler \ | ||
-rf text -rff log-jmh-persistent-collections-space.txt | ||
fi |
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