Repository navigation
[6.x] Lowercase what an equals where is looking for once - #15894
Merged
jasonvarga merged 2 commits intoNov 13, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
where('field', $value)on a Stache query lowercases the value it's looking for again for every item it's compared with.filterWhereBasic()callsfilterTestEquals($item, $value)for each value in the index, through a method name it builds each time, and that method lowercases both sides. The value being looked for is the same throughout. A front-end page here makes 90,000 to 200,000 of those calls, which comes to 15 to 30 ms.For
=with a string, number, boolean or null, the value is now lowercased once and each item is compared with the same expressionfilterTestEquals()uses. Everything else goes the way it did: other operators, values that aren't scalar (dates, arrays), and any query builder that has its ownfilterTestEquals().Numbers
Filtering 2,000 index values by equality: 0.31 ms before, 0.10 ms after, whether the values are booleans, short strings or ids.
Whole requests, each in its own process, four alternating rounds of eight:
Each of those differences is under twice the run's noise taken on its own; they all go the same way and are the size the direct timing predicts. Every response is byte for byte the same.
Tests
Nothing here can fail without the change, since it isn't meant to change any result. The tests pin what equals means so that it stays that way: twelve values (case, a trailing space, null and empty, booleans, numbers as numbers and as strings, accents), a date, and a query builder with its own
filterTestEquals()still having it used.