mdbx: Merge branch 'master' into nexenta.

This commit is contained in:
Leo Yuriev
2016-04-28 08:21:43 +03:00
18 changed files with 563 additions and 482 deletions

View File

@@ -18,8 +18,8 @@ prefix ?= /usr/local
mandir ?= $(prefix)/man
CC ?= gcc
XCFLAGS ?=
CFLAGS ?= -O2 -ggdb3 -Wall -Werror -DNDEBUG=1
XCFLAGS ?= -DNDEBUG=1 -DMDB_DEBUG=0
CFLAGS ?= -O2 -g3 -Wall -Werror -Wextra
CFLAGS += -pthread $(XCFLAGS)
IOARENA ?= ../ioarena.git/@BUILD/src/ioarena
@@ -76,7 +76,7 @@ libmdbx.a: mdbx.o
$(AR) rs $@ $^
libmdbx.so: mdbx.lo
$(CC) $(CFLAGS) $(LDFLAGS) -pthread -shared -o $@ $^
$(CC) $(CFLAGS) $(LDFLAGS) -save-temps -pthread -shared -o $@ $^
liblmdb.a: lmdb.o
$(AR) rs $@ $^
@@ -168,23 +168,28 @@ ifneq ($(wildcard $(IOARENA)),)
.PHONY: bench clean-bench re-bench
bench: bench-lmdb.txt bench-mdbx.txt
clean-bench:
rm -rf bench-*.txt _ioarena
rm -rf bench-*.txt _ioarena/*
re-bench: clean-bench bench
NN := 25000000
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