You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf(grid): fast zero-allocation numeric stat formatting in GridSelectionCalcEngine #1531
In GridSelectionCalcEngine.formatNum (lib/features/workspace/grid_selection_calc_engine.dart), whenever the user drags or modifies a selection in the data grid: formatted.replaceAll(RegExp(r'0+$'), '').replaceAll(RegExp(r'\.$'), '')
is invoked for each summary metric (Sum, Avg, Min, Max).
This dynamically compiles two RegExp instances and runs two regex replacement passes on every pointer movement.
Solution
Trim trailing 0 and . characters using a zero-allocation backward index scan on code units (codeUnitAt).
Only perform a single substring slice when trailing characters actually exist.
Benefits
0 RegExp compilations during continuous cell selection drag.
Fixed on dev by 42a0290: perf(grid): no regex in formatNum, no comma copy in selection stats. It reaches main with the next dev to main merge (closed after checking the code and its tests).
Activity
Merge pull request #1614 from QueryaHub/issue/1531-selection-calc
ZhuchkaTriplesix commentedon Oct 25, 2026
Fixed on dev by 42a0290: perf(grid): no regex in formatNum, no comma copy in selection stats. It reaches main with the next dev to main merge (closed after checking the code and its tests).