From 9871e24670c7fcb44173f4ba88f8276efa11ca7b Mon Sep 17 00:00:00 2001 From: Leo Yuriev Date: Fri, 15 Apr 2016 21:44:42 +0300 Subject: [PATCH] mdbx: refine 'bench' make target. Change-Id: Ib0594f45ee4b4eedfd18b60483d104913321585e --- Makefile | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index 25df09e3..142c73fe 100644 --- a/Makefile +++ b/Makefile @@ -160,23 +160,28 @@ ifneq ($(wildcard $(IOARENA)),) .PHONY: bench clean-bench re-bench -bench: bench-lmdb.txt bench-mdbx.txt - clean-bench: rm -rf bench-*.txt _ioarena re-bench: clean-bench bench +NN := 1000000 +define bench-rule +bench-$(1).txt: $(3) $(IOARENA) Makefile + $(IOARENA) -D $(1) -B crud -m nosync -n $(2) | tee $$@ | grep throughput \ + && $(IOARENA) -D $(1) -B get,iterate -m sync -r 4 -n $(2) | tee -a $$@ | grep throughput \ + || rm -f $$@ + +endef + +$(eval $(call bench-rule,mdbx,$(NN),libmdbx.so)) + +$(eval $(call bench-rule,lmdb,$(NN))) + +$(eval $(call bench-rule,dummy,$(NN))) + +$(eval $(call bench-rule,debug,10)) + bench: bench-lmdb.txt bench-mdbx.txt -bench-mdbx.txt: libmdbx.so $(IOARENA) - $(IOARENA) -D mdbx -B crud -m nosync -n 10000000 | tee $@ \ - && $(IOARENA) -D mdbx -B get,iterate -m sync -r 4 -n 10000000 | tee -a $@ \ - || rm -f $@ - -bench-lmdb.txt: $(IOARENA) - $(IOARENA) -D lmdb -B crud -m nosync -n 10000000 | tee $@ \ - && $(IOARENA) -D lmdb -B get,iterate -m sync -r 4 -n 10000000 | tee -a $@ \ - || rm -f $@ - endif