From 6180c6622c88ca33d0d387a50be9036429281598 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sat, 6 Dec 2025 16:07:11 +0000 Subject: chore: add benchmarks (#2229) * chore: add benchmarks * upgrade deps * fixes * lint --- packages/benchmarks/README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 packages/benchmarks/README.md (limited to 'packages/benchmarks/README.md') diff --git a/packages/benchmarks/README.md b/packages/benchmarks/README.md new file mode 100644 index 00000000..2d6cb06a --- /dev/null +++ b/packages/benchmarks/README.md @@ -0,0 +1,32 @@ +# Karakeep Benchmarks + +This package spins up a production-like Karakeep stack in Docker, seeds it with a sizeable dataset, then benchmarks a handful of high-signal APIs. + +## Usage + +```bash +pnpm --filter @karakeep/benchmarks bench +``` + +The command will: + +- Start the docker-compose stack on a random free port +- Create a dedicated benchmark user, tags, lists, and hundreds of bookmarks +- Run a suite of benchmarks (create, list, search, and list metadata calls) +- Print a table with ops/sec and latency percentiles +- Tear down the containers and capture logs (unless you opt out) + +## Configuration + +Control the run via environment variables: + +- `BENCH_BOOKMARKS` (default `400`): number of bookmarks to seed +- `BENCH_TAGS` (default `25`): number of tags to seed +- `BENCH_LISTS` (default `6`): number of lists to seed +- `BENCH_SEED_CONCURRENCY` (default `12`): concurrent seeding operations +- `BENCH_TIME_MS` (default `1000`): time per benchmark case +- `BENCH_WARMUP_MS` (default `300`): warmup time per case +- `BENCH_NO_BUILD=1`: reuse existing docker images instead of rebuilding +- `BENCH_KEEP_CONTAINERS=1`: leave the stack running after the run + +The stack uses the package-local `docker-compose.yml` and serves a tiny HTML fixture from `setup/html`. -- cgit v1.2.3-70-g09d2