Skip to content

Improve performance for many entities#3078

Merged
jleibs merged 40 commits intomainfrom
andreas/improved-entity-system-queries
Aug 29, 2023
Merged

Improve performance for many entities#3078
jleibs merged 40 commits intomainfrom
andreas/improved-entity-system-queries

Conversation

@Wumpf
Copy link
Copy Markdown
Member

@Wumpf Wumpf commented Aug 22, 2023

What

Improves both the per space view rendering and the space view adding heuristic. In particular on the later there's still significant gains to be made.
Most importantly we should be scaling now much better with number of added systems.

Went fairly early with the decision to have the primary datastructure to pass around be a Map<System, Vec<Entity>> (conceptual) instead of the other way round since this is what we need in the systems most of the time.
This is another step towards a stronger contract of systems specifying what components they will query ahead of time!

The way it is implemented on thr (rename from BlueprintTree 💥) SpaceViewContents also paves the way for ui selection of systems for a given entity path which complements the ongoing work on our new data ingestion interfaces.


Testcase:
examples/python/open_photogrammetry_format/main.py --no-frames, fully reset viewer and then hiding NOT REMOVING the points (the world/pcl entity) and deselecting them.
(The bold marked pieces are very important as they have an influence on what heuristics run - see #3077)

Before:
image

After:
image

(release runs, averaged over a bunch of frames on my M1 Max)

Highlights:

  • AppState::show: 24.0ms ➡️ 14.6ms

(slight number discrepancies from the screenshot are due to doing a different run)


Draft todo: Code sanity check. Suspecting some heuristics might be slightly broken, need to go through examples

Checklist

@Wumpf Wumpf added 📉 performance Optimization, memory use, etc 📺 re_viewer affects re_viewer itself labels Aug 22, 2023
@Wumpf Wumpf marked this pull request as ready for review August 23, 2023 11:38
@Wumpf Wumpf force-pushed the andreas/improved-entity-system-queries branch from 359e562 to 60540f7 Compare August 23, 2023 11:50
@emilk
Copy link
Copy Markdown
Member

emilk commented Aug 25, 2023

cargo r -p raw_mesh is also a pretty good benchmark

@github-actions
Copy link
Copy Markdown
Contributor

Size changes

Name Previous Current Change
Wasm (none) 13.84 MiB +100%
JS (none) 109.66 kiB +100%
arkit_scenes.rrd (none) 40.35 MiB +100%
detect_and_track_objects.rrd (none) 55.22 MiB +100%
dicom_mri.rrd (none) 63.36 MiB +100%
dna.rrd (none) 0.62 MiB +100%
human_pose_tracking.rrd (none) 55.58 MiB +100%
plots.rrd (none) 0.19 MiB +100%
structure_from_motion.rrd (none) 6.83 MiB +100%

@jleibs jleibs merged commit 41d2cbd into main Aug 29, 2023
@jleibs jleibs deleted the andreas/improved-entity-system-queries branch August 29, 2023 00:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📉 performance Optimization, memory use, etc 📺 re_viewer affects re_viewer itself

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Slowdown with 1'000 entities

3 participants