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

Minimize crate deps of the logging SDK to improve compile times #4788

Open
emilk opened this issue Jan 11, 2024 · 2 comments
Open

Minimize crate deps of the logging SDK to improve compile times #4788

emilk opened this issue Jan 11, 2024 · 2 comments
Labels
dependencies concerning crates, pip packages etc enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed 🦀 Rust API Rust logging API

Comments

@emilk
Copy link
Member

emilk commented Jan 11, 2024

We want to lower the threshold for someone to use rerun or re_sdk to just log data to a file, and then open that file in app.rerun.io. That includes minimizing the amount of dependencies one has to build. If someone does cargo add rerun and sees 200 dependencies being pulled in, they may very well abort.

So: to use the SDK to only log to a file should be possible with a minimal set of dependencies; mostly just Arrow.

In the future we could add support for the native viewer streaming and .rrd file that is being written to by the SDK, thus still supporting spawn even without WebSockets:

cargo tree -p rerun -e normal is good tool for working on this, as is cargo build --timings -p rerun --no-default-features

@emilk emilk added enhancement New feature or request 🦀 Rust API Rust logging API dependencies concerning crates, pip packages etc labels Jan 11, 2024
@emilk emilk added this to the Triage milestone Jan 11, 2024
@emilk emilk added the 🏎️ Quick Issue Can be fixed in a few hours or less label Jan 11, 2024
@emilk emilk removed the 🏎️ Quick Issue Can be fixed in a few hours or less label Jan 16, 2024
emilk added a commit that referenced this issue Jan 16, 2024
* Part of #4788

### What
* `rerun` has a new opt-in feature `run`
* `re_log` has a new opt-in feature `setup`
* `re_log_encoding` has a new opt-in feature `stream_from_http`
* …and other smaller fixes

### Result
* `cargo build -p re_sdk -F default` 269 -> 218 dependencies
* `cargo build -p rerun --no-default-features` 364 -> 226 dependencies
* `cargo build -p rerun -F sdk` 370 -> 286 dependencies
* `cargo build -p rerun -F default` 383 -> 339 dependencies

Yes, this is still _a lot_.


![sisyphus](https://github.com/rerun-io/rerun/assets/1148717/aa1fbdd6-1f0f-4d20-ae1c-724caacef7a3)

### 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):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/4824/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/4824/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/4824/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [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/4824)
- [Docs
preview](https://rerun.io/preview/a5cf84457e7f2b1399a4e0c3e803e2351f44551a/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/a5cf84457e7f2b1399a4e0c3e803e2351f44551a/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
@emilk emilk changed the title Minimize logging SDK dependencies Minimize logging SDK dependencies to improve compile times Feb 7, 2024
@emilk emilk mentioned this issue Feb 7, 2024
@emilk
Copy link
Member Author

emilk commented Feb 7, 2024

cargo clean && cargo build --timings -p rerun --no-default-features produces this:

image

What the hell is egui doing there? (fix: #5099)

And wasm-bindgen for a native build makes no sense either.

teh-cmc added a commit that referenced this issue Feb 7, 2024
### What
Part of #4788

We need to start tracking the number of dependencies and/or compile-time
of `re_sdk`: #5101.

@v-morlock pointed out in
https://github.com/rerun-io/rerun/issues/5095we accidentally pull in all
of `egui` 🤦

This PR fixes that.

---------

Co-authored-by: Clement Rey <[email protected]>
emilk added a commit that referenced this issue Feb 21, 2024
### What
* Part of #4788
* Closes #5101

### 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):
* Using newly built examples:
[app.rerun.io](https://app.rerun.io/pr/5228/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/5228/index.html?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[app.rerun.io](https://app.rerun.io/pr/5228/index.html?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

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

---------

Co-authored-by: jprochazk <[email protected]>
@emilk emilk changed the title Minimize logging SDK dependencies to improve compile times Minimize crate deps of the logging SDK to improve compile times Apr 11, 2024
@emilk emilk modified the milestones: Triage, Spring Cleaning Apr 24, 2024
@emilk
Copy link
Member Author

emilk commented May 20, 2024

One important crate to focus on is re_sdk.

cargo tree -p re_sdk reveals some deps that should be removed:

  • serde
  • env_logger
  • backtrace
  • fixed
  • num-derive
  • comfy-table
  • similar-asserts
  • time
  • re_memory

build-deps:

  • cargo_metadata
  • sha2
  • walkdir

@emilk emilk added good first issue Good for newcomers help wanted Extra attention is needed labels May 20, 2024
emilk added a commit that referenced this issue Jul 5, 2024
## What
* Closes #5315

## egui changelog

### ⭐ Added
* Add `Image::uri()` [#4720](emilk/egui#4720) by
[@rustbasic](https://github.com/rustbasic)

### 🔧 Changed
* Better documentation for `Event::Zoom`
[#4778](emilk/egui#4778) by
[@emilk](https://github.com/emilk)
* Hide tooltips when scrolling
[#4784](emilk/egui#4784) by
[@emilk](https://github.com/emilk)
* Smoother animations [#4787](emilk/egui#4787)
by [@emilk](https://github.com/emilk)
* Hide tooltip on click [#4789](emilk/egui#4789)
by [@emilk](https://github.com/emilk)

### 🐛 Fixed
* Fix default height of top/bottom panels
[#4779](emilk/egui#4779) by
[@emilk](https://github.com/emilk)
* Show the innermost debug rectangle when pressing all modifier keys
[#4782](emilk/egui#4782) by
[@emilk](https://github.com/emilk)
* Fix occasional flickering of pointer-tooltips
[#4788](emilk/egui#4788) by
[@emilk](https://github.com/emilk)

## eframe changelog
* Web: only capture clicks/touches when actually over canvas
[#4775](emilk/egui#4775) by
[@lucasmerlin](https://github.com/lucasmerlin)

## 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):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6785?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6785?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6785)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
emilk added a commit that referenced this issue Jul 5, 2024
## What
* Closes #5315

## egui changelog

### ⭐ Added
* Add `Image::uri()` [#4720](emilk/egui#4720) by
[@rustbasic](https://github.com/rustbasic)

### 🔧 Changed
* Better documentation for `Event::Zoom`
[#4778](emilk/egui#4778) by
[@emilk](https://github.com/emilk)
* Hide tooltips when scrolling
[#4784](emilk/egui#4784) by
[@emilk](https://github.com/emilk)
* Smoother animations [#4787](emilk/egui#4787)
by [@emilk](https://github.com/emilk)
* Hide tooltip on click [#4789](emilk/egui#4789)
by [@emilk](https://github.com/emilk)

### 🐛 Fixed
* Fix default height of top/bottom panels
[#4779](emilk/egui#4779) by
[@emilk](https://github.com/emilk)
* Show the innermost debug rectangle when pressing all modifier keys
[#4782](emilk/egui#4782) by
[@emilk](https://github.com/emilk)
* Fix occasional flickering of pointer-tooltips
[#4788](emilk/egui#4788) by
[@emilk](https://github.com/emilk)

## eframe changelog
* Web: only capture clicks/touches when actually over canvas
[#4775](emilk/egui#4775) by
[@lucasmerlin](https://github.com/lucasmerlin)

## 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):
* Using examples from latest `main` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6785?manifest_url=https://app.rerun.io/version/main/examples_manifest.json)
* Using full set of examples from `nightly` build:
[rerun.io/viewer](https://rerun.io/viewer/pr/6785?manifest_url=https://app.rerun.io/version/nightly/examples_manifest.json)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG
* [x] If applicable, add a new check to the [release
checklist](https://github.com/rerun-io/rerun/blob/main/tests/python/release_checklist)!

- [PR Build Summary](https://build.rerun.io/pr/6785)
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)

To run all checks from `main`, comment on the PR with `@rerun-bot
full-check`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies concerning crates, pip packages etc enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed 🦀 Rust API Rust logging API
Projects
None yet
Development

No branches or pull requests

1 participant