Skip to content

perf: optimise cell reference parsing#623

Open
alexander-beedie wants to merge 1 commit intotafia:masterfrom
alexander-beedie:perf-parse-cell-ref
Open

perf: optimise cell reference parsing#623
alexander-beedie wants to merge 1 commit intotafia:masterfrom
alexander-beedie:perf-parse-cell-ref

Conversation

@alexander-beedie
Copy link
Contributor

@alexander-beedie alexander-beedie commented Mar 9, 2026

Micro-optimisation

Slightly simpler/faster get_row_and_optional_column implementation. Uses forward-accumulation (acc = acc * base + digit) instead of reverse-accumulation (acc += digit * pow; pow *= base). Saves a "multiply-and-store" per byte, and avoids the need for a state flag/branch (readrow).

Performance

Marginal gains; it's fundamentally not an expensive function as cell references are tiny. Nevertheless, benchmarking on large sheets shows a consistent ~0.5-1.0% speedup as it's called so often.

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