-
-
Notifications
You must be signed in to change notification settings - Fork 362
feat(Table): improve performance for GetVisibleColumns function #6886
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideReplaced repeated LINQ iterator allocations in visible-columns filtering by introducing a precomputed HashSet and refactoring GetVisibleColumns to use O(1) lookups. Class diagram for updated Table component visible columns logicclassDiagram
class Table {
- List<ColumnVisibleItem> VisibleColumns
- HashSet<string> VisibleColumnNames
+ IEnumerable<ITableColumn> GetVisibleColumns()
+ void InternalResetVisibleColumns(List<ITableColumn> columns, IEnumerable<string> names)
}
class ColumnVisibleItem {
- string Name
- bool Visible
}
class ITableColumn {
+ string GetFieldName()
+ bool GetIgnore()
+ int ShownWithBreakPoint
}
Table "1" *-- "*" ColumnVisibleItem : manages
Table "1" *-- "*" ITableColumn : filters
ColumnVisibleItem "*" --> "1" ITableColumn : matches by Name
Flow diagram for optimized visible columns filteringflowchart TD
A["VisibleColumns (List<ColumnVisibleItem>)"] --> B["VisibleColumnNames (HashSet<string>)"]
B --> C["GetVisibleColumns()"]
C --> D["Columns.Where(...) using VisibleColumnNames.Contains"]
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Thanks for your PR, @kimdiego2098. Someone from the team will get assigned to your PR shortly and we'll get it reviewed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6886 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 739 739
Lines 31765 31765
Branches 4466 4466
=========================================
Hits 31765 31765
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@sourcery-ai summary |
Issues
close #6888
Summary by Sourcery
Improve the performance of column visibility filtering by materializing the filtered items, optimizing lookups, and renaming the internal collection field.
Enhancements: