Repository navigation
Conversation
For every cell a criterion cloned the value, copied its text, tokenized the pattern again and lowercased the text into a new vector, even with no wildcard in sight. The pattern is now tokenized once, the cell is borrowed, and a pattern without wildcards compares character by character with no copy. Results don't change: a test checks the shortcut against the general match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
For every cell it looked at, a criterion cloned the cell's value, copied its text, tokenized the pattern again and lowercased the text into a new vector. That happened even when the pattern had no wildcard, which is the usual case for
COUNTIFSand friends.The pattern is now tokenized once, when the criterion is parsed, and the cell is borrowed. A pattern without wildcards compares character by character with no copy. A pattern with wildcards takes the same path as before.
Measurements
Release builds,
gridcraft-cli convert, on a generated workbook: 20,000 rows, two of the four columns formulas, and 3,000COUNTIFSover whole columns with four criteria.Values: across 216 private workbooks (404,081 formula cells) every computed value matched main, and so did a private report with 244,621 formulas.
Testing
a_pattern_without_wildcards_matches_as_the_general_match_doescompares the shortcut with the general matcher, including case,İ,ß, and~escapes.fmt, assets, layers and wasm pass, and so does clippy on
gridcraft-calc,gridcraft-functionsandgridcraft-engine. Tests for those three crates: 1197 pass, 1 fails (engineering::tests::complex_numbers, a last-digit difference on my Windows machine in a test this PR doesn't touch). I ran these steps separately becausecargo xtask cidoesn't pass on my machine, for reasons outside this change (see #3267).This is independent of #2757, which adds an index for single-pair literal text criteria.
Summary by CodeRabbit