Skip to content

fix: Improve performance of variable name comparisons - #10175

Merged
gonfunko merged 1 commit into
mainfrom
you-got-a-fast-var
Jul 23, 2026
Merged

fix: Improve performance of variable name comparisons#10175
gonfunko merged 1 commit into
mainfrom
you-got-a-fast-var

Conversation

@gonfunko

Copy link
Copy Markdown
Contributor

The basics

The details

Proposed Changes

This PR improves the performance of blocks and fields referencing variables. I forget where exactly this was turning up as a performance pitfall, but variable fields load and sort all the variables in the dropdown when the field is created using this method. localeCompare() winds up constructing one of these expensive collator objects behind the scenes, so just creating one once and then using it gives a significant performance improvement, while still allowing for fancy locale-aware sorting of variable names.

@gonfunko
gonfunko requested a review from a team as a code owner July 23, 2026 17:52
@gonfunko
gonfunko requested a review from lizschwab July 23, 2026 17:52
@github-actions github-actions Bot added the PR: fix Fixes a bug label Jul 23, 2026
@gonfunko
gonfunko merged commit 70cda32 into main Jul 23, 2026
9 checks passed
@gonfunko
gonfunko deleted the you-got-a-fast-var branch July 23, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: fix Fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants