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

Clean up pass over all superfluous hashing happening on the query path #8207

Merged
merged 7 commits into from
Nov 25, 2024

Conversation

teh-cmc
Copy link
Member

@teh-cmc teh-cmc commented Nov 22, 2024

2x-3x perf improvements in scenes with many entities 😬

Before:
image

After:
image

@teh-cmc teh-cmc added ⛃ re_datastore affects the datastore itself 🔍 re_query affects re_query itself 🚀 performance Optimization, memory use, etc include in changelog labels Nov 22, 2024
Copy link

github-actions bot commented Nov 22, 2024

Web viewer built successfully. If applicable, you should also test it:

  • I have tested the web viewer
Result Commit Link
d898a4e https://rerun.io/viewer/pr/8207

Note: This comment is updated whenever you push a commit.

@teh-cmc
Copy link
Member Author

teh-cmc commented Nov 22, 2024

@rerun-bot full-check

Copy link

Started a full build: https://github.com/rerun-io/rerun/actions/runs/11974807708

@teh-cmc teh-cmc changed the title Global clean up pass for all superfluous hashing on the query path Clean up pass over all superfluous hashing happening on the query path Nov 22, 2024
@teh-cmc
Copy link
Member Author

teh-cmc commented Nov 22, 2024

@rerun-bot full-check

Copy link

Started a full build: https://github.com/rerun-io/rerun/actions/runs/11975363476

@teh-cmc teh-cmc marked this pull request as ready for review November 22, 2024 22:47
@Wumpf Wumpf self-requested a review November 25, 2024 09:12
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

looks all sane to me. Crazy how impactful this is, great finds!

🤞 this didn't introduce unordering where there shouldn't be any, but looks tractable


timelines.sort_by(|(field1, _times1), (field2, _times2)| field1.name.cmp(&field2.name));
Copy link
Member

Choose a reason for hiding this comment

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

a bit surprised we care about the order in the transport chunk?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do! RecordBatches respect the order of columns so keeping it stable is pretty important, otherwise the UX for end users is pretty awful.

Comment on lines +7 to +8
"37.0 MiB in total",
"37 B per row",
Copy link
Member

Choose a reason for hiding this comment

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

.. hurray...?
So not sorting in some places saved memory? Guess something randomly compacted better?

}

/// Retrieve all [`ComponentName`]s in the store.
pub fn all_components_sorted(&self) -> ComponentNameSet {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe we should rename this type to OrderedComponentNameSet to pair it up with UnorderedComponentNameSet, a bit confusing in the context of this PR :/

(or even better imho ComponentNameOrderedSet & ComponentNameUnorderedSet for friendlier autocomplete)

Copy link
Member Author

Choose a reason for hiding this comment

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

I wanted to, but the UI code already exposes a SortedComponentSet with slightly different rules... 🤪

Copy link
Member

Choose a reason for hiding this comment

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

🙈

@Wumpf
Copy link
Member

Wumpf commented Nov 25, 2024

I want this and none of the questions/comment here are blocking enough to not just merge this.

@Wumpf Wumpf merged commit 317319c into main Nov 25, 2024
65 checks passed
@Wumpf Wumpf deleted the cmc/intmaps_everywhere branch November 25, 2024 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
include in changelog 🚀 performance Optimization, memory use, etc ⛃ re_datastore affects the datastore itself 🔍 re_query affects re_query itself
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants