save ~4-5% CPU at 100hz, we don't modify after so no need to deepcopy

btw pickle.loads(pickle.dumps()) is faster by ~1% CPU
pull/33208/head
Shane Smiskol 1 year ago
parent c547a9628f
commit 1a61723c2c
  1. 6
      selfdrive/car/interfaces.py

@ -1,4 +1,3 @@
import copy
import json
import os
import numpy as np
@ -247,9 +246,8 @@ class CarInterfaceBase(ABC):
if ret.cruiseState.speedCluster == 0:
ret.cruiseState.speedCluster = ret.cruiseState.speed
# copy back for next iteration
# TODO: do we need to deepcopy?
self.CS.out = copy.deepcopy(ret)
# save for next iteration
self.CS.out = ret
return ret

Loading…
Cancel
Save