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

Pass viewer context always non-mutable #4438

Merged
merged 1 commit into from Dec 5, 2023
Merged

Conversation

Wumpf
Copy link
Member

@Wumpf Wumpf commented Dec 5, 2023

What

What it says on the tin!
No additional review required, just waiting for rust ci to be sure :)

Checklist

  • I have read and agree to Contributor Guide and the Code of Conduct
  • I've included a screenshot or gif (if applicable)
  • I have tested the web demo (if applicable):
    • Full build: app.rerun.io
    • Partial build: app.rerun.io - Useful for quick testing when changes do not affect examples in any way
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

Part of series towards more multithreading in the viewer!

@Wumpf Wumpf added 📺 re_viewer affects re_viewer itself 🚜 refactor Change the code, not the functionality include in changelog labels Dec 5, 2023
@Wumpf Wumpf merged commit c849b74 into main Dec 5, 2023
41 of 44 checks passed
@Wumpf Wumpf deleted the andreas/non-mut-viewer_ctx branch December 5, 2023 16:51
@Wumpf Wumpf mentioned this pull request Dec 7, 2023
4 tasks
Wumpf added a commit that referenced this pull request Dec 11, 2023
### What

* Fixes #1325 

Two levels of parallism actually:
* All context & part systems for a single space view each run in
parallel
* All space views now in parallel first setup their query and then kick
of their (parallized!) system execution

This gives us major speedups whenever:
* There is several heavy systems in a scene (e.g. a lot of points and a
lot of arrows)
* There is several space views

As such this is a very fundamental & widely applicable parallelization!


![image](https://github.com/rerun-io/rerun/assets/1220815/14bc6ca8-abb0-480b-91dc-2da51253dd92)
(a rather silly "points with arrows" scene duplicated a bunch of times.
Note that we still don't have any caching, so all these space views
might as well be animated individually!)

<img width="1421" alt="image"
src="https://github.com/rerun-io/rerun/assets/1220815/57e13e15-9d8f-4a30-bf74-d8174676986d">
(busy rayon worker threads!)


Related things that are not parallel yet:
* ui methods per space view (run one by one)
* draw call recording (done as part of the ui method, but we could
likely do this in parallel, only joining on these tasks when egui wants
to queue up the command buffers)
* processing _within_ a system depends on the system at hand. Today,
only point cloud has some parallization


### 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 the web demo (if applicable):
  * Full build: [app.rerun.io](https://app.rerun.io/pr/4460/index.html)
* Partial build:
[app.rerun.io](https://app.rerun.io/pr/4460/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
- Useful for quick testing when changes do not affect examples in any
way
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4460)
- [Docs
preview](https://rerun.io/preview/cb7e9a9902bb9923ade41271ccc43ed01a2a4d33/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/cb7e9a9902bb9923ade41271ccc43ed01a2a4d33/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

---
End of a series on refactors leading to this parallization:
* #4387
* #4404
* #4389
* #4421
* #4422 
* #4430
* #4438
* #4460

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog 📺 re_viewer affects re_viewer itself 🚜 refactor Change the code, not the functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant