-
Notifications
You must be signed in to change notification settings - Fork 373
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
A nice speed up of 3D points clouds by ~69% #3114
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
emilk
added
📺 re_viewer
affects re_viewer itself
🚀 performance
Optimization, memory use, etc
labels
Aug 27, 2023
emilk
commented
Aug 27, 2023
@@ -219,3 +219,23 @@ impl ViewPartSystem for Points3DPart { | |||
self | |||
} | |||
} | |||
|
|||
/// Run 4 things in parallel | |||
fn join4<A: Send, B: Send, C: Send, D: Send>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder where we should put helpers like these. Yet another helper crate (re_parallel
)?
emilk
changed the title
Speed up 3D points clouds by another ~20%
Speed up 3D points clouds by another ~25%
Aug 27, 2023
emilk
force-pushed
the
emilk/parallelize-points3d
branch
from
August 27, 2023 18:11
627302b
to
23c1d02
Compare
emilk
changed the title
Speed up 3D points clouds by another ~25%
Speed up 3D points clouds by another ~50%
Aug 27, 2023
emilk
changed the title
Speed up 3D points clouds by another ~50%
Speed up 3D points clouds by another ~68%
Aug 27, 2023
emilk
changed the title
Speed up 3D points clouds by another ~68%
A nice speed up 3D points clouds by another ~69%
Aug 27, 2023
emilk
changed the title
A nice speed up 3D points clouds by another ~69%
A nice speed up of 3D points clouds by ~69%
Aug 27, 2023
Zooming in on what's slow now, it is obvious that we need to optimize the Color deserializer: |
Size changes
|
teh-cmc
approved these changes
Aug 28, 2023
teh-cmc
pushed a commit
that referenced
this pull request
Aug 28, 2023
### What On native, use `rayon` to parallelize the gathering of positions, radii, colors, and picking ids. Of course, this only works on native. I also noticed that we spent a lot of time generating identical annotation infos for all the points, so I happy-pathed that. Test: `cargo rerun-release ../opf.rrd --profile`, looking at just the 3D view, averaged over ~30 frames: Full frame 37.0ms -> 26.6ms ≈ 39% faster `Points3DPart`: 25.7ms -> 15.2ms ≈ 69% faster Before: ![Screenshot 2023-08-27 at 17 39 52](https://github.com/rerun-io/rerun/assets/1148717/95b2de1b-ab21-489b-8e05-039e8de50692) After: ![image](https://github.com/rerun-io/rerun/assets/1148717/2e0f7dc7-ccce-4cd8-9157-162bb642c795) ### Checklist * [x] I have read and agree to [Contributor Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and the [Code of Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md) * [x] I've included a screenshot or gif (if applicable) * [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/3114/examples/structure_from_motion/) (if applicable) - [PR Build Summary](https://build.rerun.io/pr/3114) - [Docs preview](https://rerun.io/preview/d70a51a580149f974aec0c089fb8f899e132c518/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/d70a51a580149f974aec0c089fb8f899e132c518/examples) <!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
On native, use
rayon
to parallelize the gathering of positions, radii, colors, and picking ids. Of course, this only works on native. I also noticed that we spent a lot of time generating identical annotation infos for all the points, so I happy-pathed that.Test:
cargo rerun-release ../opf.rrd --profile
, looking at just the 3D view, averaged over ~30 frames:Full frame 37.0ms -> 26.6ms ≈ 39% faster
Points3DPart
: 25.7ms -> 15.2ms ≈ 69% fasterBefore:
After:
Checklist