Table CPU Performance Improvements (#7392)

* dereactifying the row before passing it to the commponent

* debouncin

* i mean... throttle
This commit is contained in:
Jamie V
2024-01-26 10:40:16 -08:00
committed by GitHub
parent 3e31bbef97
commit b985619d16

View File

@ -234,7 +234,7 @@
:object-path="objectPath" :object-path="objectPath"
:row-offset="rowOffset" :row-offset="rowOffset"
:row-height="rowHeight" :row-height="rowHeight"
:row="row" :row="getRow(rowIndex)"
:marked="row.marked" :marked="row.marked"
@mark="markRow" @mark="markRow"
@unmark="unmarkRow" @unmark="unmarkRow"
@ -288,6 +288,7 @@ import _ from 'lodash';
import { toRaw } from 'vue'; import { toRaw } from 'vue';
import stalenessMixin from '@/ui/mixins/staleness-mixin'; import stalenessMixin from '@/ui/mixins/staleness-mixin';
import throttle from '../../../utils/throttle';
import CSVExporter from '../../../exporters/CSVExporter.js'; import CSVExporter from '../../../exporters/CSVExporter.js';
import ProgressBar from '../../../ui/components/ProgressBar.vue'; import ProgressBar from '../../../ui/components/ProgressBar.vue';
@ -504,6 +505,8 @@ export default {
}); });
} }
this.updateVisibleRows = throttle(this.updateVisibleRows, 1000);
this.table.on('object-added', this.addObject); this.table.on('object-added', this.addObject);
this.table.on('object-removed', this.removeObject); this.table.on('object-removed', this.removeObject);
this.table.on('refresh', this.clearRowsAndRerender); this.table.on('refresh', this.clearRowsAndRerender);
@ -633,6 +636,9 @@ export default {
this.calculateScrollbarWidth(); this.calculateScrollbarWidth();
}, },
getRow(rowIndex) {
return toRaw(this.visibleRows[rowIndex]);
},
sortBy(columnKey) { sortBy(columnKey) {
// If sorting by the same column, flip the sort direction. // If sorting by the same column, flip the sort direction.
if (this.sortOptions.key === columnKey) { if (this.sortOptions.key === columnKey) {