mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-22 16:13:12 +09:00
Big charting performance increase for master
This commit is contained in:
1 parent
b016f36667
commit
8d63bb896a
1 file changed
+6
-1
@@ -483,7 +483,12 @@ app.post("/api/getTimelineStats", function(req,res) {
|
|||||||
docs.forEach(el => {
|
docs.forEach(el => {
|
||||||
for(let key in el.data) {
|
for(let key in el.data) {
|
||||||
if(el.data[key] === '0') {
|
if(el.data[key] === '0') {
|
||||||
delete el.data[key];
|
// Set value to undefined instead of using the delete keyword.
|
||||||
|
// This is because the delete keyword is super duper slow.
|
||||||
|
// https://stackoverflow.com/questions/208105/how-do-i-remove-a-property-from-a-javascript-object
|
||||||
|
|
||||||
|
//delete el.data[key];
|
||||||
|
el.data[key] = undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user