-
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
Changed spawn()
and the rerun
script to call into rerun_bindings
(12x startup time improvement)
#4053
Conversation
…run_bindings` (12x startup time improvement)
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.
Awesome! Have you tested that spawn
still works?
Speaking of |
Yes.
Excellent point. Let me take a look at that. |
@teh-cmc Easy enough! |
rerun
(python) script to call into rerun_bindings
(12x startup time improvement)spawn()
and the rerun
script to call into rerun_bindings
(12x startup time improvement)
- Slowness was fixed by #4053 ### What ### 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/4073) (if applicable) * [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/4073) - [Docs preview](https://rerun.io/preview/7199492ed9a4765beddd326569584f48c385e1ae/docs) <!--DOCS-PREVIEW--> - [Examples preview](https://rerun.io/preview/7199492ed9a4765beddd326569584f48c385e1ae/examples) <!--EXAMPLES-PREVIEW--> - [Recent benchmark results](https://ref.rerun.io/dev/bench/) - [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
What
Python package can include so-called "scripts" definitiosn, which are recognised by pip, pipx, etc. When they exist, a stub script is created upon package installation which calls into the defined python function. We use this to map
rerun
to launch the viewer from the binary embedded in our wheels.So far, this was done as follows (from
pyproject.toml
):The drawback of this is that the entire
rerun
SDK package was loaded (including numpy, Pillow, etc.), incurring a ~300+ms startup time.This PR changes it to:
This drastically reduces the loading time, as the
rerun
python package is no longer loaded. The signature of our binding'smain
function needed to be changed: it now internally reads fromsys.argv
instead of accepting an argument.This PR also changes
spawn()
to call directly into the bindings, with the same loading time benefit.Note: This PR improves startup time when running
rerun
in a venv (with the SDK installed), or when installed via pipx. The startup time ofpython -m rerun
is not improved, as this still involves loading thererun
python package.Benchmark
Checklist