Commit fffc34ff authored by Yoni Fogel's avatar Yoni Fogel

Merged [12502] (db benchmark runbenchmarks.sh features moved into makefile)...

Merged [12502] (db benchmark runbenchmarks.sh features moved into makefile) from 2.0.1 to 2.0.0 and main

git-svn-id: file:///svn/toku/tokudb@12503 c7de825b-a66e-492c-adef-691d508d4ae1
parent 84b50d85
......@@ -107,7 +107,7 @@ check-4G: $(TARGET_TDB) $(SCANSCAN_TDB)
clean:
rm -f $(TARGETS) 4g.out
rm -rf $(BENCHDBS)
rm -rf *.dir $(BENCHDBS)
$(TARGET_TDB) $(SCANSCAN_TDB) $(SCANRACE_TDB): BIN_FROM_C_FLAGS+=-DDIRSUF=tokudb -I$(PORTABILITY_HEADERS) -I$(TOKUROOT)toku_include -I$(TOKUROOT)include
......@@ -163,3 +163,57 @@ PARGS =
ptest%: $(TARGET_TDB)
./$< --env $@.dir $(PARGS)
parallel-test-8: ptest0 ptest1 ptest2 ptest3 ptest4 ptest5 ptest6 ptest7
#benchmarks
.PHONY: %.manybenchmark
.PHONY: %.manyflattenedscan %.flattenedscan
.PHONY: %.manyflatteningscan %.flatteningscan
BENCH_TIME=time
SCAN_TIME=time
BENCH_RUNS=5
QUIET_BENCH_ARG=
%.manybenchmark: SHELL=/bin/bash
%.manybenchmark:
$(BENCH_TIME) for (( i = 0; i < $(BENCH_RUNS); i++ )) ; do rm -f $*.benchmark.dir; $(MAKE) -s $*.benchmark.dir BENCH_TIME= QUIET_BENCH_ARG=-q ; done
%.benchmark.dir: SHELL=/bin/bash
%.benchmark.dir: $(TARGET_TDB)
rm -rf $@
$(BENCH_TIME) ./$< --env $@ $(QUIET_BENCH_ARG) $(EXTRA_BENCH_ARGS)
no-txn.benchmark.dir: EXTRA_BENCH_ARGS=
txn.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock
abort.benchmark.dir: EXTRA_BENCH_ARGS= -x --singlex --prelock --abort
QUIET_SCAN_ARG=
SCANSCAN_ARGS=--lwc --prelock --prelockflag --cachesize 268435456 # scanscan default, cache of windows (256MB)
SCANSCAN_TDB = scanscan-tokudb$(BINSUF)
%.manyflatteningscan: SHELL=/bin/bash
%.manyflatteningscan:
$(SCAN_TIME) for (( i = 0; i < $(BENCH_RUNS); i++ )) ; do rm -f $*.flatteningscan; $(MAKE) -s $*.flatteningscan SCAN_TIME= "QUIET_SCAN_ARG= >/dev/null" ; done
%.flatteningscan: QUIET_BENCH_ARG=-q
%.flatteningscan: SHELL=/bin/bash
%.flatteningscan: BENCH_TIME=
%.flatteningscan: $(SCANSCAN_TDB) %.benchmark.dir
rm -rf $@.dir
cp -R $*.benchmark.dir $@.dir
$(SCAN_TIME) ./$< --env $@.dir $(SCANSCAN_ARGS) $(QUIET_SCAN_ARG)
%.manyflattenedscan: SHELL=/bin/bash
%.manyflattenedscan: %.flattenedscan.dir
$(SCAN_TIME) for (( i = 0; i < $(BENCH_RUNS); i++ )) ; do rm -f $*.flattenedscan; $(MAKE) -s $*.flattenedscan SCAN_TIME= "QUIET_SCAN_ARG= >/dev/null" ; done
%.flattenedscan.dir: QUIET_BENCH_ARG=-q
%.flattenedscan.dir: QUIET_SCAN_ARGS=-q
%.flattenedscan.dir: BENCH_TIME=
%.flattenedscan.dir: $(SCANSCAN_TDB) %.benchmark.dir
cp -R $*.benchmark.dir $@
./$< --env $@ $(SCANSCAN_ARGS) $(QUIET_SCAN_ARG)
%.flattenedscan: SHELL=/bin/bash
%.flattenedscan: $(SCANSCAN_TDB) %.flattenedscan.dir
$(SCAN_TIME) ./$< --env $@.dir $(SCANSCAN_ARGS)$(QUIET_SCAN_ARG)
#!/bin/bash
#Export BINSUF before running
make db-benchmark-test-tokudb$BINSUF
make scanscan-tokudb$BINSUF
alias db='./db-benchmark-test-tokudb$BINSUF' # standard db-benchmark test
alias db='rm -rf bench.db && ./db-benchmark-test-tokudb$BINSUF' # standard db-benchmark test
alias dbtxn='db -x --singlex --prelock' # db-benchmark test with single transaction
alias dbabort='dbtxn --abort' # db-benchmark test with single transaction (AND ABORT) at end
alias scan='./scanscan-tokudb$BINSUF --lwc --prelock --prelockflag --cachesize 268435456' # scanscan default, cache of windows (256MB)
alias flatteneddb='db && scan'
alias flattenedtxndb='dbtxn && scan'
alias flatteningscan='(db 2>&1 >/dev/null) && scan'
alias flatteningtxnscan='(dbtxn 2>&1 >/dev/null) && scan'
(flatteningscan)2>&1 >/dev/null # Cache binaries/etc.
echo db-benchmark-test no transactions
db
echo Time for 5 runs:
time for (( i = 0; i < 5; i++ )); do (db) 2>&1 >/dev/null; done
echo
echo ============================
echo db-benchmark-test single transactions
dbtxn
echo Time for 5 runs:
time for (( i = 0; i < 5; i++ )); do (dbtxn) 2>&1 >/dev/null; done
echo
echo ============================
echo db-benchmark-test single transactions ABORT at end
dbabort
echo Time for 5 runs:
time for (( i = 0; i < 5; i++ )); do (dbabort) 2>&1 >/dev/null; done
echo
echo ============================
echo flattening scanscan
flatteningscan
echo Time for 5 runs:
time for (( i = 0; i < 5; i++ )); do (flatteningscan) 2>&1 >/dev/null; done
echo
echo ============================
echo flattening scanscan on txn db
flatteningtxnscan
echo Time for 5 runs:
time for (( i = 0; i < 5; i++ )); do (flatteningtxnscan) 2>&1 >/dev/null; done
echo
echo ============================
echo pre-flattened scanscan
(flatteneddb) 2>&1 >/dev/null
scan
echo Time for 5 runs:
time for (( i = 0; i < 5; i++ )); do (scan) 2>&1 >/dev/null; done
echo
echo ============================
echo pre-flattened scanscan on txn db
(flattenedtxndb) 2>&1 >/dev/null
scan
echo Time for 5 runs:
time for (( i = 0; i < 5; i++ )); do (scan) 2>&1 >/dev/null; done
echo
echo ============================
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment