mirror of
https://github.com/nasa/openmct.git
synced 2024-12-21 22:17:49 +00:00
only dupe check when needed
Only enable datum dupe checking in collection after data has been received. This works under the assumption that a single telemetry request will not contain duplicate elements, thus, it is not necessary to check for dupes on the initial request. Improves performance when rows are sorted by a column that has duplicate row-values.
This commit is contained in:
parent
284dec4903
commit
2d352ac574
@ -32,6 +32,7 @@ define(
|
||||
*/
|
||||
function TelemetryCollection() {
|
||||
EventEmitter.call(this, arguments);
|
||||
this.dupeCheck = false;
|
||||
this.telemetry = [];
|
||||
this.highBuffer = [];
|
||||
this.sortField = undefined;
|
||||
@ -161,7 +162,7 @@ define(
|
||||
var startIx = _.sortedIndex(array, item, this.sortField);
|
||||
var endIx;
|
||||
|
||||
if (startIx !== array.length) {
|
||||
if (this.dupeCheck && startIx !== array.length) {
|
||||
endIx = _.sortedLastIndex(array, item, this.sortField);
|
||||
|
||||
// Create an array of potential dupes, based on having the
|
||||
|
@ -292,6 +292,7 @@ define(
|
||||
*/
|
||||
function finishProcessing() {
|
||||
telemetryCollection.add(rowData);
|
||||
telemetryCollection.dupeCheck = true;
|
||||
scope.rows = telemetryCollection.telemetry;
|
||||
scope.loading = false;
|
||||
|
||||
@ -377,6 +378,7 @@ define(
|
||||
function newData(domainObject, datum) {
|
||||
limitEvaluator = telemetryApi.limitEvaluator(domainObject);
|
||||
added = telemetryCollection.add([table.getRowValues(limitEvaluator, datum)]);
|
||||
this.telemetry.dupeCheck = true;
|
||||
}
|
||||
|
||||
objects.forEach(function (object) {
|
||||
|
Loading…
Reference in New Issue
Block a user