Skip to content

Commit

Permalink
perf(planning_debug_tools): improve calculation time of perception_re…
Browse files Browse the repository at this point in the history
…producer (#5894)

Signed-off-by: Takayuki Murooka <takayuki5168@gmail.com>
  • Loading branch information
takayuki5168 authored Dec 18, 2023
1 parent 68e7434 commit d06e42f
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,14 @@ def on_timer(self):

# copy the messages
self.stopwatch.tic("message deepcopy")
msgs = pickle.loads(pickle.dumps(msgs_orig)) # this is x5 faster than deepcopy
objects_msg = msgs[0]
traffic_signals_msg = msgs[1]
if self.args.detected_object:
msgs = pickle.loads(pickle.dumps(msgs_orig)) # this is x5 faster than deepcopy
objects_msg = msgs[0]
traffic_signals_msg = msgs[1]
else:
# NOTE: No need to deepcopy since only timestamp will be changed and it will be changed every time correctly.
objects_msg = msgs_orig[0]
traffic_signals_msg = msgs_orig[1]
self.stopwatch.toc("message deepcopy")

self.stopwatch.tic("transform and publish")
Expand Down

0 comments on commit d06e42f

Please sign in to comment.