misaksson / CarND-Capstone

MIT License
2 stars 4 forks source link

No deepcopy in waypoint updater #33

Closed misaksson closed 6 years ago

misaksson commented 6 years ago

The waypoint_updater copies 200 base_waypoints and use this as a starting point for the final_waypoints. This copy is implemented as a deepcopy, which consumes an surprisingly large amount of CPU time, e.g. around 100 ms on the Udacity workspace. The deepcopy is however no longer needed as the target velocity is calculated from the base_waypoints during initialization, and the velocity for all final_waypoints are explicitly modified for each update. A shallow copy takes almost no time, so this solves the problem.