mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 16:24:12 +08:00
mdbx-test: alter/refine iteration loops.
Change-Id: I78657b0c736d84dc3fbb75ad28a9465cad0ff4b2
This commit is contained in:
parent
bfad1f7086
commit
4da4ab3650
@ -176,7 +176,7 @@ function probe {
|
||||
echo "=============================================== $(date)"
|
||||
echo "${caption}: $*"
|
||||
rm -f ${TESTDB_DIR}/* \
|
||||
&& ${VALGRIND} ./mdbx_test --ignore-dbfull --repeat=3 --pathname=${TESTDB_DIR}/long.db "$@" --cleanup-after=no | tee >(lz4 > ${TESTDB_DIR}/long.log.lz4) | grep -e reach -e achieve \
|
||||
&& ${VALGRIND} ./mdbx_test --ignore-dbfull --repeat=3 --pathname=${TESTDB_DIR}/long.db --cleanup-after=no "$@" | tee >(lz4 > ${TESTDB_DIR}/long.log.lz4) | grep -e reach -e achieve \
|
||||
&& ${VALGRIND} ./mdbx_chk ${TESTDB_DIR}/long.db | tee ${TESTDB_DIR}/long-chk.log \
|
||||
&& ([ ! -e ${TESTDB_DIR}/long.db-copy ] || ${VALGRIND} ./mdbx_chk ${TESTDB_DIR}/long.db-copy | tee ${TESTDB_DIR}/long-chk-copy.log) \
|
||||
|| (echo "FAILED"; exit 1)
|
||||
@ -185,81 +185,80 @@ function probe {
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
count=0
|
||||
for nops in 10 10000 100 1000 10000000; do
|
||||
exp=$(expr length "$nops")
|
||||
loops=$(( (exp < 5) ? 5 - exp : 1 ))
|
||||
cases='?'
|
||||
for nops in 10 100 1000 10000 100000 1000000 10000000 100000000 1000000000; do
|
||||
wbatch=$((nops / 10 + 1))
|
||||
while true; do
|
||||
wbatch=$(((wbatch > 9) ? wbatch / 10 : 1))
|
||||
for ((rep=0; rep++ < loops; )); do
|
||||
subcase=0
|
||||
for ((bits=2**${#options[@]}; --bits >= 0; )); do
|
||||
seed=$(($(date +%s) + RANDOM))
|
||||
|
||||
split=30
|
||||
caption="Probe #$((++count)) int-key,with-dups, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) int-key,with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+key.integer,+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
caption="Probe #$((++count)) int-key,int-data, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) int-key,int-data, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+key.integer,+data.integer --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
caption="Probe #$((++count)) with-dups, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
|
||||
split=24
|
||||
caption="Probe #$((++count)) int-key,with-dups, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) int-key,with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+key.integer,+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
caption="Probe #$((++count)) int-key,int-data, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) int-key,int-data, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+key.integer,+data.integer --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
caption="Probe #$((++count)) with-dups, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
|
||||
split=16
|
||||
caption="Probe #$((++count)) int-key,w/o-dups, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) int-key,w/o-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+key.integer,-data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
caption="Probe #$((++count)) int-key,with-dups, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) int-key,with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+key.integer,+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
caption="Probe #$((++count)) int-key,int-data, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) int-key,int-data, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+key.integer,+data.integer --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
caption="Probe #$((++count)) w/o-dups, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) w/o-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=-data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
caption="Probe #$((++count)) with-dups, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) with-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
|
||||
split=4
|
||||
caption="Probe #$((++count)) int-key,w/o-dups, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) int-key,w/o-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+key.integer,-data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
caption="Probe #$((++count)) int-key,int-data, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) int-key,int-data, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=+key.integer,+data.integer --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=max \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
caption="Probe #$((++count)) w/o-dups, split=${split}, repeat ${rep} of ${loops}" probe \
|
||||
caption="Probe #$((++count)) w/o-dups, split=${split}, case $((++subcase)) of ${cases}" probe \
|
||||
--pagesize=min --size-upper=${db_size_mb}M --table=-data.dups --keygen.split=${split} --keylen.min=min --keylen.max=max --datalen.min=min --datalen.max=1111 \
|
||||
--nops=$nops --batch.write=$wbatch --mode=$(bits2list options $bits) \
|
||||
--keygen.seed=${seed} basic
|
||||
done # options
|
||||
done # repeats
|
||||
cases="${subcase}"
|
||||
if [ $wbatch -eq 1 -o $((nops / wbatch)) -gt 1000 ]; then break; fi
|
||||
done # batch (write-ops per txn)
|
||||
done # n-ops
|
||||
|
Loading…
x
Reference in New Issue
Block a user