Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid unnecessary addPoints in PointCloudCommon::update #1122

Merged
merged 1 commit into from
Aug 17, 2017
Merged

Avoid unnecessary addPoints in PointCloudCommon::update #1122

merged 1 commit into from
Aug 17, 2017

Conversation

tmoinel
Copy link
Contributor

@tmoinel tmoinel commented Jul 10, 2017

After adding new points to the PointCloud, setRenderMode call regenerateAll which remove all points and add then again (to apply the new render mode).
As the PointCloud is just created, it is empty. So calling setRenderMode before addPoints avoid the regeneration and improve performance.

This is an easy performance improvement, there a lot a copying in this plugin that hurt perf, with patterns like allocating a lot of memory to throw it right away from each new incoming pointcloud (or depth_cloud). I might find some time to dig more deeply into it.

@wjwwood
Copy link
Member

wjwwood commented Aug 4, 2017

Thanks for the pr! The change looks straightforward, but I'm going to delay it until the next release because I want to release it when we have time for some soak time in the testing repository, since this change could have subtle side effects on point cloud rendering (it is a potentially high impact change).

@wjwwood
Copy link
Member

wjwwood commented Aug 17, 2017

Thanks again for the patch! I've tested it out myself, and I didn't notice any difference off-hand. I'll merge this and ask for some extra testing from people while it is in the testing repository.

@wjwwood wjwwood merged commit b01e255 into ros-visualization:kinetic-devel Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants