perf(xlsx): the sheet filter's attribute scan is slower since the parser-equivalent tokenizer

Open
#411 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript, node.js

Research direction

Start by profiling with npm run bench -w pivotkit-xlsx; the issue points to packages/pivotkit-xlsx/src/xml.js, especially eachAttr and tagEnd. Compare the results with the figures in docs/reference/plugins.md, then investigate ways to speed up the attribute scan while preserving what it accepts. Done means the benchmark figures are current, the scan is faster, and the advisory tests still pass.

Written by the indexing model from the issue text.

Description

idea

read() of a sheet formatted down to row 900,000 got slower with the parser-equivalent tokenizer from the GHSA-c6vh-q36c-92r3 fix:

Commit read()
730e60a (before the fix) 0.66 s
9ec50d4 and later 0.80 s

Under V8 coverage it takes about twice as long. That pushed the old absolute time bound in the used-range test over its limit on CI, which #404 / #405 fixed.

Most of the time goes to eachAttr and tagEnd in packages/pivotkit-xlsx/src/xml.js. The benchmark figures in docs/reference/plugins.md (4.4 s / 4.0 s for the 52 MB case) predate the fix and may be stale.

To do:

  • Profile with npm run bench -w pivotkit-xlsx and update the docs figures.
  • Speed up the attribute scan without changing what it accepts. The equivalence with the parser is the security property, so the advisory's tests must stay green.
Dominant language
JavaScript
Stars
1
Forks
1
Avg merge
3h 21m
Merged PRs (30d)
250

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from eizedev/pivotkit

All issues in eizedev/pivotkit

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.