← 输入框|github.com|刷新
Skip to content

Dispatch number format tokens on the first character - #795

Merged
appel1 merged 1 commit into
ExcelDataReader:developfrom
g4lb:perf/number-format-dispatch
Nov 27, 2026
Merged

appel1 merged 1 commit into
ExcelDataReader:developfrom
g4lb:perf/number-format-dispatch

Conversation

@g4lb

@g4lb g4lb commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Parser.ReadToken tries approximately 20 matchers for each token. This change uses the first character of the token to select the matcher. The output does not change.

ParseCustomFormats and ParseLongFormats, 12 interleaved runs, Apple M2 Max:

Format net10.0 net8.0
"0.00" -19.6% -17.1%
"yyyy-mm-dd hh:mm:ss.000" -30.9% -30.2%
Long, Dates -31.3% -29.2%
Long, Digits -7.3% -6.5%
Long, Directives -2.9% -2.7%

No benchmark became slower. The library parses each custom format one time when it opens a workbook.

@appel1
appel1 merged commit 243edc6 into ExcelDataReader:develop Nov 27, 2026
5 checks passed
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.

2 participants