Optimize PathSet for V8
PathSet.find has been rewritten without using ES6 generators in order to avoid V8's TurboFan/Crankshift optimization bailout.
This commit is contained in:
1 parent
a48984b909
commit
3223e9733a
5 files changed
+115
-138
No files matched your search
+1
-1
@@ -339,7 +339,7 @@ saveDevice = (deviceId, deviceData, isNew, callback) ->
|
||||
if not diff[2]? and diff[1]?
|
||||
update['$unset'][diff[0].slice(0, -1).concat('_timestamp').join('.')] = 1
|
||||
else if diff[2] != diff[1]
|
||||
parent = deviceData.paths.subset(diff[0].slice(0, -1)).next().value
|
||||
parent = deviceData.paths.get(diff[0].slice(0, -1))
|
||||
if parent and (parent.length == 0 or deviceData.attributes.has(parent))
|
||||
update['$set'][diff[0].slice(0, -1).concat('_timestamp').join('.')] = new Date(diff[2])
|
||||
|
||||
|
||||
Reference in new issue
Block a user