Skip to content

perf(wasm): skip empty metadata probes on cell writes - #74

Closed
chh-ay wants to merge 2 commits into
perf/core-gapsfrom
perf/engine-gaps
Closed

chh-ay wants to merge 2 commits into
perf/core-gapsfrom
perf/engine-gaps

Conversation

@chh-ay

@chh-ay chh-ay commented Oct 6, 2026

Copy link
Copy Markdown
Owner

Scope

Faster bulk writes in both engines. Part of #59. Stacked on #73 (base perf/core-gaps).

Problem

Profiles of 1,000,000-row ingestion showed every written cell paying hash probes into the sheet's formula and spill maps, even when a sheet has no formulas and no spills, which is the usual case for loaded data.

Change

  • SheetData::remove_formula removes a cell's formula and skips the hash when the sheet has none. Every write path in store.rs uses it.
  • prepare_cell_write returns at once when the sheet has no spill metadata.
  • setBlockPacked skips per-cell source lookups for blocks that carry no formula sources.

Measurement

Both locks held, one pinned CPU, each side loading its own built package; outputs identical.

Workload Before After Change
1,000,000-row mixed-column ingestion 1,311.7 ms 850.0 ms −35.2%
Window read, sort, filter, distinct, aggregate (untouched) −0.6% to +2.3%

A/A control: 9 rounds, paired noise within ±3.4%. ABBA: 9 rounds. Centralizing the guard in one helper was checked against the first version: +2.7% (within ±3%).

Size

Binary Before After Change
Default raw 793,255 793,973 +718 (+0.09%)
Default Brotli q11 238,012 237,888 −124
Full raw 1,076,283 1,077,002 +719

Verification

  • Rust 147 (default) and 223 (--features analysis) pass; library clippy passes in both configurations.
  • Build, docs:check, api:check, typecheck, lint pass; packages 869 pass / 6 skip / 0 fail.

Centralize empty-map formula removal in SheetData and skip spill metadata probes when no spill exists. Nine alternating comparison rounds improve one-million-row mixed-column ingestion by 35.2%; five better-warmed rounds keep the centralized helper within 2.67% of the original optimization, with identical output and 718 bytes of justified default wasm growth.
@chh-ay
chh-ay added this pull request to stack #69 October 6, 2026 08:45
@chh-ay

chh-ay commented Oct 17, 2026

Copy link
Copy Markdown
Owner Author

Landed on develop in the 0.5.0 release squash: #112 (55cfa82).

@chh-ay chh-ay closed this Oct 17, 2026
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