Repository navigation
perf(grid): cheaper per-row filter predicates, one selection test per row, cheaper clipboard export - #1681
Merged
Conversation
… cell only for numeric targets; one selection test per row; cheaper clipboard export
3 tasks
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.
From the review of conditions on hot paths. Refs #1550.
Filter (
grid_filter_engine.dart, runs once per row)trim+double.tryParseon every cell).evaluateno longer walks three stringswitches per row._FreeTextNodelower-cases its term once, not per row. The substring fallback lower-cases each cell once per row, not once per term.Grid rows (
grid_row_renderer.dart): the selection test is done once per row and once per cell instead of up to six times per cell.Clipboard (
grid_selection_manager.dart)toJson: a cheap first-character check before the two number parses, and an allocation-freetrue/falsecomparison. Side effect: text such asInfinity/NaNstays text instead of becoming a double thatjsonEncodecannot encode.containsscans.Tests for numeric vs text targets, case-insensitive free text, JSON edge values and CSV/TSV quoting. Not measured; the gains are estimated from the code.