Table CPU Performance Improvements ()

* 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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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