Skip to content

feat: Added fast hot patch for getColumn#3

Open
dvmoritzschoefl wants to merge 1 commit into
mh/add_row_model_middlewarefrom
mh/sort_performance
Open

feat: Added fast hot patch for getColumn#3
dvmoritzschoefl wants to merge 1 commit into
mh/add_row_model_middlewarefrom
mh/sort_performance

Conversation

@dvmoritzschoefl

Copy link
Copy Markdown

Problem:

  • Memo chain in getColumn caused sorts to take roughly 15 seconds
  • This simple change improves it to 3 seconds

Further:

The sorting function is actually very bad and can improved a lot (maybe in v9?). Just as an example:

image

calls the value getters again. mabye a "pre sort" value cache would be an option?

Comment on lines +336 to +342
columnsById = table.getAllFlatColumns().reduce(
(acc, column) => {
acc[column.id] = column
return acc
},
{} as Record<string, Column<TData, unknown>>
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not using table._getAllFlatColumnsById()[columnId]?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants