Skip to content

Commit e17fddd

Browse files
committed
Scripts: support benchmarking all data types
1 parent c948847 commit e17fddd

File tree

6 files changed

+47
-32
lines changed

6 files changed

+47
-32
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,22 @@ The results here-below were computed on May the 21st, 2017 with the following li
108108

109109
## Run
110110

111-
By default, running `./bench ser` (`./bench deser` respectively) will run
111+
By default, running `./run ser` (`./run deser` respectively) will run
112112
all -- stream and databind -- serialization (deserialization respectively)
113113
benchmarks with 1 KB payloads of _Users_.
114114

115115
You can also specificy which libs, apis, payload-sizes and number of
116116
iterations (and more) you want to run. For example:
117117

118-
./bench deser --apis stream --libs genson,jackson
119-
./bench ser --apis databind,stream --libs jackson
120-
./bench deser --apis stream --libs dsljson,jackson --size 10 --datatype users
118+
./run deser --apis stream --libs genson,jackson
119+
./run ser --apis databind,stream --libs jackson
120+
./run deser --apis stream --libs dsljson,jackson --size 10 --datatype users
121121

122-
Type `./bench help ser` or `./bench help deser` to print help for those
122+
Type `./run help ser` or `./run help deser` to print help for those
123123
commands.
124124

125125
If you wish to run _all_ benchmarks used to generate the reports above,
126-
you can run `./bench-all`. This will take several hours to complete, so
126+
you can run `./run-everything`. This will take several hours to complete, so
127127
be patient.
128128

129129
## Contribute

bench

Lines changed: 0 additions & 12 deletions
This file was deleted.

bench-all

Lines changed: 0 additions & 13 deletions
This file was deleted.

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ plugins {
55
}
66

77
apply plugin: 'java'
8+
apply plugin: 'application'
89

910
group = 'com.github.fabienrenaud'
1011
version = '3'
12+
mainClassName = 'com.github.fabienrenaud.jjb.Cli'
1113

1214
sourceCompatibility = 1.8
1315
targetCompatibility = 1.8
@@ -93,7 +95,7 @@ dependencies {
9395
}
9496

9597
shadowJar {
96-
baseName = 'benchmarks'
98+
archiveName = 'app.jar'
9799
exclude 'META-INF/*.SF'
98100
exclude 'META-INF/*.DSA'
99101
exclude 'META-INF/*.RSA'

run

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env sh -e
2+
3+
JAR=build/libs/app.jar
4+
5+
[ -z ${JVM_OPTIONS} ] && JVM_OPTIONS="-server -XX:+AggressiveOpts -Xms2G -Xmx2G"
6+
[ -z ${SEED} ] && export SEED=${RANDOM}
7+
[ -z ${SHADOW} ] && echo ./gradlew clean build shadowJar && ./gradlew clean build shadowJar
8+
9+
exec java ${JVM_OPTIONS} -jar ${JAR} $*

run-everything

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env sh -e
2+
3+
DATA_TYPES="users clients"
4+
NUMBERS="1"
5+
SIZES="1 10 100 1000"
6+
COMMANDS="ser deser"
7+
8+
echo ./gradlew clean build shadowJar
9+
./gradlew clean build shadowJar
10+
11+
export SEED=${RANDOM}
12+
export SHADOW="done"
13+
14+
for datatype in ${DATA_TYPES}; do
15+
for n in ${NUMBERS}; do
16+
for size in ${SIZES}; do
17+
for command in ${COMMANDS}; do
18+
outputFile="output/${command}-${n}-${size}-${datatype}.txt"
19+
echo ./run ${command} --number ${n} --size ${size} --datatype ${datatype}
20+
./run ${command} \
21+
--number ${n} \
22+
--size ${size} \
23+
--datatype ${datatype} \
24+
> ${outputFile}
25+
done
26+
done
27+
done
28+
done
29+

0 commit comments

Comments
 (0)