Skip to content
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

Table CPU Performance Improvements #7392

Merged
merged 5 commits into from
Jan 26, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/plugins/telemetryTable/components/TableComponent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
:object-path="objectPath"
:row-offset="rowOffset"
:row-height="rowHeight"
:row="row"
:row="getRow(rowIndex)"
:marked="row.marked"
@mark="markRow"
@unmark="unmarkRow"
Expand Down Expand Up @@ -287,6 +287,7 @@
import { toRaw } from 'vue';

import stalenessMixin from '@/ui/mixins/staleness-mixin';
import throttle from '../../../utils/throttle';

Check warning on line 290 in src/plugins/telemetryTable/components/TableComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/plugins/telemetryTable/components/TableComponent.vue#L290

Added line #L290 was not covered by tests

import CSVExporter from '../../../exporters/CSVExporter.js';
import ProgressBar from '../../../ui/components/ProgressBar.vue';
Expand Down Expand Up @@ -503,6 +504,8 @@
});
}

this.updateVisibleRows = throttle(this.updateVisibleRows, 1000);

Check warning on line 507 in src/plugins/telemetryTable/components/TableComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/plugins/telemetryTable/components/TableComponent.vue#L507

Added line #L507 was not covered by tests

this.table.on('object-added', this.addObject);
this.table.on('object-removed', this.removeObject);
this.table.on('refresh', this.clearRowsAndRerender);
Expand Down Expand Up @@ -632,6 +635,9 @@

this.calculateScrollbarWidth();
},
getRow(rowIndex) {

Check warning on line 638 in src/plugins/telemetryTable/components/TableComponent.vue

View check run for this annotation

Codecov / codecov/patch

src/plugins/telemetryTable/components/TableComponent.vue#L638

Added line #L638 was not covered by tests
return toRaw(this.visibleRows[rowIndex]);
},
sortBy(columnKey) {
// If sorting by the same column, flip the sort direction.
if (this.sortOptions.key === columnKey) {
Expand Down
Loading