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

Improve entity size stats: include whole subtree #4542

Merged
merged 6 commits into from Dec 15, 2023
Merged

Conversation

emilk
Copy link
Member

@emilk emilk commented Dec 14, 2023

What

Previously when hovering an entity, only the memory used by its own components was shown.
Now the entire subtree is included, which makes much more sense as an answer to the analagous question "how much space is this folder taking up?"

size-stats

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):
  • The PR title and labels are set such as to maximize their usefulness for the next release's CHANGELOG

@emilk emilk added ui concerns graphical user interface include in changelog labels Dec 14, 2023
@@ -88,22 +88,47 @@ pub struct SubtreeInfo {
///
/// ⚠ Auto-generated instance keys are _not_ accounted for. ⚠
pub time_histogram: TimeHistogramPerTimeline,

/// Number of bytes used by all arrow data in this tree (ignores overhead from book-keeping, schemas, etc).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The size of the cell does take into account the copy of the arrow schema that is stored in the cell

match event.kind {
StoreDiffKind::Addition => {
self.time_histogram
.add(&event.times, event.num_components() as _);

for cell in event.cells.values() {
self.data_bytes += cell.heap_size_bytes();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cells themselves are also stored on the heap at this point, so you want total_size_bytes()

@emilk emilk merged commit 899f72b into main Dec 15, 2023
40 checks passed
@emilk emilk deleted the emilk/better-size-stats branch December 15, 2023 10:12
emilk added a commit that referenced this pull request Dec 15, 2023
They are still not exactlty _small_, but a lot _smaller_, and since they
all stream, it should be pretty fine anyways

```
detect_and_track_objects.rrd (55.3 MiB)
nuscenes.rrd (90.0 MiB)
objectron.rrd (81.1 MiB)
open_photogrammetry_format.rrd (67.6 MiB)
raw_mesh.rrd (116 kiB)
rgbd.rrd (36.8 MiB)
segment_anything_model.rrd (8.5 MiB)
```

This helped in figuring out what to focus on:
* #4542

### 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/4545/index.html)
* Using examples from latest `main` build:
[app.rerun.io](https://app.rerun.io/pr/4545/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/4545/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/4545)
- [Docs
preview](https://rerun.io/preview/4aa4c24e403c16b455d8be8b02b98d5c8164fa53/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/4aa4c24e403c16b455d8be8b02b98d5c8164fa53/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://build.rerun.io/graphs/crates.html)
- [Wasm size tracking](https://build.rerun.io/graphs/sizes.html)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog ui concerns graphical user interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants