rename project to MultiforaDB
Prose and benchmark tables use MultiforaDB; the binary, the CLI usage line, the log-message prefix and the default database file use multiforadb. Two consequences worth noting: - build.zig.zon's fingerprint is derived from the package name, so it had to change with it (Zig refuses to build otherwise). A consumer pinning this package by fingerprint needs updating. - the default --db path is now multiforadb.log, and getCmdLineOpts reports it as dbpath. An existing mongo-lite.log has to be passed explicitly with --db. The e2e harness abbreviated the old name as ML_; that is now MFDB_, including the documented ML_BIN override (MFDB_BIN) and the scratch file names. MD_ (mongod) is untouched. compare-run.sh spawned the server by absolute path under a sandbox/mongo-lite directory that no longer exists; that block already runs from tests/e2e, so it uses a relative path now. The archived reports under tests/e2e/results/ keep the old name: they record what the old binary measured.
This commit is contained in:
@@ -4,10 +4,10 @@
|
||||
# bash tests/e2e/bench-run.sh [size] [doc-size] [clients...]
|
||||
# (defaults: 1g, 16k, "1 4 8 16 32"; clients apply to the concurrent phase)
|
||||
#
|
||||
# Runs the compare-run.sh main suite (mongo-lite vs mongod, same driver,
|
||||
# Runs the compare-run.sh main suite (multiforadb vs mongod, same driver,
|
||||
# durable writes) plus the concurrent durable-write comparison, then writes
|
||||
# a versioned machine-readable report to tests/e2e/results/ and prints a
|
||||
# diff of the mongo-lite numbers against the previous run.
|
||||
# diff of the multiforadb numbers against the previous run.
|
||||
set -u
|
||||
cd "$(dirname "$0")/../.."
|
||||
SIZE="${1:-1g}"; DOC="${2:-16k}"; CLIENTS="${3:-1 4 8 16 32}"
|
||||
@@ -35,8 +35,8 @@ echo "### concurrent durable insertOne (clients: $CLIENTS)" >&2
|
||||
rm -rf "$TMP/mongod" && mkdir -p "$TMP/mongod"
|
||||
mongod --dbpath "$TMP/mongod" --port 27018 --bind_ip 127.0.0.1 --quiet >"$TMP/md.out" 2>&1 &
|
||||
MD_PID=$!
|
||||
./zig-out/bin/mongo-lite --port 27019 --db "$TMP/ml.log" --compact-threshold 1g >"$TMP/ml.out" 2>&1 &
|
||||
ML_PID=$!
|
||||
./zig-out/bin/multiforadb --port 27019 --db "$TMP/mfdb.log" --compact-threshold 1g >"$TMP/mfdb.out" 2>&1 &
|
||||
MFDB_PID=$!
|
||||
# Poll both servers with the real driver until they answer (fresh mongod
|
||||
# dbpaths can take several seconds; a fixed sleep is flaky).
|
||||
wait_ready() { # $1 = url
|
||||
@@ -47,25 +47,25 @@ wait_ready() { # $1 = url
|
||||
done
|
||||
return 1
|
||||
}
|
||||
wait_ready mongodb://127.0.0.1:27018 || { echo "mongod never became ready" >&2; kill -9 $MD_PID $ML_PID 2>/dev/null; exit 1; }
|
||||
wait_ready mongodb://127.0.0.1:27019 || { echo "mongo-lite never became ready" >&2; kill -9 $MD_PID $ML_PID 2>/dev/null; exit 1; }
|
||||
wait_ready mongodb://127.0.0.1:27018 || { echo "mongod never became ready" >&2; kill -9 $MD_PID $MFDB_PID 2>/dev/null; exit 1; }
|
||||
wait_ready mongodb://127.0.0.1:27019 || { echo "multiforadb never became ready" >&2; kill -9 $MD_PID $MFDB_PID 2>/dev/null; exit 1; }
|
||||
CC="$TMP/cc.txt"
|
||||
for C in $CLIENTS; do
|
||||
MD=$(node tests/e2e/concurrent.js --url mongodb://127.0.0.1:27018 --label mongodb --clients "$C" --per-client "$PER_CLIENT" 2>/dev/null | tail -1)
|
||||
ML=$(node tests/e2e/concurrent.js --url mongodb://127.0.0.1:27019 --label mongo-lite --clients "$C" --per-client "$PER_CLIENT" 2>/dev/null | tail -1)
|
||||
ML_D=$(echo "$ML" | sed -E 's/.*\t([0-9.]+) docs\/s.*/\1/')
|
||||
MFDB=$(node tests/e2e/concurrent.js --url mongodb://127.0.0.1:27019 --label multiforadb --clients "$C" --per-client "$PER_CLIENT" 2>/dev/null | tail -1)
|
||||
MFDB_D=$(echo "$MFDB" | sed -E 's/.*\t([0-9.]+) docs\/s.*/\1/')
|
||||
MD_D=$(echo "$MD" | sed -E 's/.*\t([0-9.]+) docs\/s.*/\1/')
|
||||
if [ -z "$ML_D" ] || [ -z "$MD_D" ]; then
|
||||
echo "WARNING: concurrent run at $C clients produced no result (ml='$ML' md='$MD')" >&2
|
||||
if [ -z "$MFDB_D" ] || [ -z "$MD_D" ]; then
|
||||
echo "WARNING: concurrent run at $C clients produced no result (mfdb='$MFDB' md='$MD')" >&2
|
||||
fi
|
||||
RATIO=$(node -e "const m=Number('$ML_D'),d=Number('$MD_D');console.log(d>0?(m/d).toFixed(1)+'x':'—')")
|
||||
echo "clients $C $ML_D $MD_D $RATIO" | tee -a "$CC"
|
||||
RATIO=$(node -e "const m=Number('$MFDB_D'),d=Number('$MD_D');console.log(d>0?(m/d).toFixed(1)+'x':'—')")
|
||||
echo "clients $C $MFDB_D $MD_D $RATIO" | tee -a "$CC"
|
||||
done
|
||||
kill -9 $MD_PID $ML_PID 2>/dev/null; wait 2>/dev/null
|
||||
kill -9 $MD_PID $MFDB_PID 2>/dev/null; wait 2>/dev/null
|
||||
|
||||
# ---- assemble the report --------------------------------------------------
|
||||
{
|
||||
echo "# mongo-lite vs MongoDB benchmark"
|
||||
echo "# multiforadb vs MongoDB benchmark"
|
||||
echo "# date: $(date -u +%Y-%m-%dT%H:%M:%SZ) git: $REV$DIRTY"
|
||||
echo "# args: size=$SIZE doc-size=$DOC wc=j clients=$CLIENTS per-client=$PER_CLIENT"
|
||||
echo "# reproduce: bash tests/e2e/bench-run.sh $SIZE $DOC \"$CLIENTS\""
|
||||
@@ -81,7 +81,7 @@ kill -9 $MD_PID $ML_PID 2>/dev/null; wait 2>/dev/null
|
||||
}
|
||||
return m;
|
||||
};
|
||||
const a = read("/tmp/mongo-cmp/ml-report.txt");
|
||||
const a = read("/tmp/mongo-cmp/mfdb-report.txt");
|
||||
const b = read("/tmp/mongo-cmp/mongo-report.txt");
|
||||
const keys = ["insertOne (sequential) ×200","bulk insert throughput","docs loaded","createIndex({k: 1})",
|
||||
"countDocuments({})","findOne({_id: <ObjectId>})","findOne({k: 500}) (indexed)","find({p: {$gte,$lt}}).count() (scan)",
|
||||
@@ -104,7 +104,7 @@ kill -9 $MD_PID $ML_PID 2>/dev/null; wait 2>/dev/null
|
||||
# ---- diff against the previous run ---------------------------------------
|
||||
echo "report: $REPORT"
|
||||
if [ -f "$LATEST" ]; then
|
||||
echo; echo "### mongo-lite numbers vs previous run ($(head -2 "$LATEST" | tail -1 | sed 's/# //'))"
|
||||
echo; echo "### multiforadb numbers vs previous run ($(head -2 "$LATEST" | tail -1 | sed 's/# //'))"
|
||||
node -e '
|
||||
const fs = require("fs");
|
||||
const old = fs.readFileSync(process.argv[1], "utf8");
|
||||
@@ -136,9 +136,9 @@ if [ -f "$LATEST" ]; then
|
||||
const d = isFinite(num(ov)) && isFinite(num(v)) && num(ov) > 0 ? ((num(v) - num(ov)) / num(ov) * 100).toFixed(0) + "%" : "";
|
||||
console.log(k.padEnd(42) + fmt(ov) + fmt(v) + d);
|
||||
}
|
||||
// concurrency (mongo-lite docs/s per client count)
|
||||
// concurrency (multiforadb docs/s per client count)
|
||||
const oc = section(old, "concurrency"), nc = section(neu, "concurrency");
|
||||
console.log("\nconcurrency — mongo-lite docs/s:");
|
||||
console.log("\nconcurrency — multiforadb docs/s:");
|
||||
for (const [k, v] of nc) {
|
||||
const ov = oc.get(k);
|
||||
const d = ov && Number(ov) > 0 ? ((Number(v) - Number(ov)) / Number(ov) * 100).toFixed(0) + "%" : "";
|
||||
|
||||
Reference in New Issue
Block a user