You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Telemetry value objects returned by the openmct-yamcs adapter include a timestamp, a value, and an id. Adding an object ID to every telemetry values adds significantly to the size of the object (potentially on the order of 30% from my testing). We should find a way to remove the need to carry an ID on every telemetry value.
Additionally, storing the timestamp as a string results in larger in-memory object sizes. We might investigate converting this to an integer which is a much more memory-efficient way of storing time. We might also get a CPU saving because the Time API needs an integer for time comparisons anyway.
Describe the solution you'd like
Remove the ID altogether. Do some performance testing of integer timestamps to understand the cost.
Reproduction steps for measuring memory usage of the different approaches
constbigObj={id: '~myproject~Gyro.z',timestamp: '2023-11-14T20:44:47.682Z',value: 18.533648};constsmolObj={timestamp: '2023-11-14T20:44:47.682Z',value: 18.533648};constsmolrObj={timestamp: 1699994687682,value: 18.533648};constbigObjects=[];constsmolObjects=[];constsmolrObjects=[];functionfillArray(array,objectToClone,size){for(leti=0;i<size;i++){// Has to be a clone otherwise you're just repeatedly pushing a reference to the same object, which is not a valid testarray.push(structuredClone(objectToClone));}}// Fill each array with 1 million objectsfillArray(bigObjects,bigObj,1000000);fillArray(smolObjects,smolObj,1000000);fillArray(smolrObjects,smolrObj,1000000);
Now open Chrome memory tab, take a heap snapshot, order by Retained Size and observe the following -
Array
Size
Change
bigObjects
113 216 992
N/A
smolObjects
81 216 920
-28%
smolrObjects
57 216 860
-49%
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Telemetry value objects returned by the openmct-yamcs adapter include a
timestamp
, avalue
, and anid
. Adding an object ID to every telemetry values adds significantly to the size of the object (potentially on the order of 30% from my testing). We should find a way to remove the need to carry an ID on every telemetry value.Additionally, storing the timestamp as a string results in larger in-memory object sizes. We might investigate converting this to an integer which is a much more memory-efficient way of storing time. We might also get a CPU saving because the Time API needs an integer for time comparisons anyway.
Describe the solution you'd like
Remove the ID altogether. Do some performance testing of integer timestamps to understand the cost.
Reproduction steps for measuring memory usage of the different approaches
Now open Chrome memory tab, take a heap snapshot, order by Retained Size and observe the following -
The text was updated successfully, but these errors were encountered: