Skip to content

Count the context's containers in one statement - #260

Merged
abrignoni merged 1 commit into
mainfrom
perf/context-container-counts
Oct 1, 2026
Merged

abrignoni merged 1 commit into
mainfrom
perf/context-container-counts

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

Counts the context's containers in one statement instead of three.

  • The kind of each container is decided once per row, and what was extracted is counted once per container.
  • On a case of 149,824 rows the counts went from 327 ms to 111 ms, and a context after a write from about 590 ms to about 366 ms.
  • The five numbers are unchanged on the cases and fixtures compared. The Type filters are not touched.
  • A new test writes the counts out for awkward rows and checks the sidebar and the filters against them.

Co-Authored-By: Claude Opus 5.5 [email protected]

The sidebar's five container counts came from three statements. Each
decided again what kind of container a row is, and two of them built the
set of every archive or document container to count what was extracted
from one. On a case of 149,824 rows, 119,604 of them containers, they
took 327 ms.

One statement now decides it once per container and counts what was
extracted once per container. It takes 111 ms on that case, and a context
worked out after a write went from 582 to 609 ms down to 355 to 382 ms.
The five numbers are the same on the cases and fixtures compared, on
SQLite 3.43.1, 3.50.4 and 3.53.4. The filters are not changed.

A new test writes the counts out for rows a count could get wrong and
holds both the statement and the filters to them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@abrignoni
abrignoni enabled auto-merge October 1, 2026 20:07
@abrignoni
abrignoni merged commit 9194907 into main Oct 1, 2026
8 checks passed
@abrignoni
abrignoni deleted the perf/context-container-counts branch October 1, 2026 20:21
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