Skip to content

bench: measure list-shaped reads (instances/load_some) - #16

Merged
deucalioncodes merged 1 commit into
mainfrom
bench/list-operations
Sep 16, 2026
Merged

deucalioncodes merged 1 commit into
mainfrom
bench/list-operations

Conversation

@deucalioncodes

Copy link
Copy Markdown
Member

Follow-up to #14 / #15. The benchmark suite only covered single-entity operations, so the range-paging change was invisible to it. Adds load_page_50, instances_all and instances_sparse (every other id deleted) to test_benchmark.py and the orchestrator.

Measured locally (same Basilisk 0.15.0 template, ic-python-db v0.11.0 vs v0.12.0), instructions:

Operation db=100 db=500 Δ @500
instances_all 131.1 M → 94.5 M 700.6 M → 488.3 M −30 %
instances_sparse (50 % deleted) 80.1 M → 47.5 M 416.7 M → 246.1 M −41 %
load_page_50 66.9 M → 47.3 M 66.9 M → 47.4 M −29 %
load 1.12 M → 1.01 M 1.18 M → 1.04 M −12 %

Deleted ids now cost nothing (sparse ≈ half of dense). The remaining ~0.95 M instructions per hydrated entity are JSON decode + Entity construction, i.e. the next optimisation target.

Made with Cursor

…ces_sparse)

The suite only covered single-entity operations, so the range-paging change
in 0.12.0 (#14) was invisible to it. Add three cases:

- load_page_50: cold load_some(1, 50)
- instances_all: cold instances() with every id present
- instances_sparse: cold instances() after deleting every other id

Measured on a local replica with the Basilisk 0.15.0 template, v0.11.0 vs
v0.12.0 (instructions, db=500 entity pairs):
  instances_all    700.6M -> 488.3M  (-30%)
  instances_sparse 416.7M -> 246.1M  (-41%)
  load_page_50      66.9M ->  47.4M  (-29%)
  load               1.18M ->  1.04M (-12%)
Remaining cost is ~0.95M instructions per hydrated entity (JSON decode +
Entity construction), which is the next target.

Co-authored-by: Cursor <cursoragent@cursor.com>
@deucalioncodes
deucalioncodes merged commit 1c1bac8 into main Sep 16, 2026
5 checks passed
@deucalioncodes
deucalioncodes deleted the bench/list-operations branch September 16, 2026 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant