From b985619d16e9196493e48f915be76046f13cb6bc Mon Sep 17 00:00:00 2001 From: Jamie V Date: Fri, 26 Jan 2024 10:40:16 -0800 Subject: [PATCH] Table CPU Performance Improvements (#7392) * dereactifying the row before passing it to the commponent * debouncin * i mean... throttle --- src/plugins/telemetryTable/components/TableComponent.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/plugins/telemetryTable/components/TableComponent.vue b/src/plugins/telemetryTable/components/TableComponent.vue index e260aad39e..5bd4866298 100644 --- a/src/plugins/telemetryTable/components/TableComponent.vue +++ b/src/plugins/telemetryTable/components/TableComponent.vue @@ -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) {