-
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
Use rerun::Collection
almost everywhere we'd use std::vector
before
#4247
Conversation
…tion. Improve various aspects of rerun::Collection and the generic converting adapter.
and namespace some macros while we're touching that
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.
Whoa, that's a lot of complex C++ 😓
Looks good though!
namespace archetypes { | ||
|
||
#ifdef EDIT_EXTENSION | ||
#if 0 |
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.
#if 0
looks wrong, though I know it is right. Perhaps add a comment, or standardize how we do this
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.
Hmmm. Need to do a pass over these. Slowly switched to the simpler if 0 variant because the other thing got implemented incorrectly too often
return data(); | ||
} | ||
|
||
/// TODO(andreas): Return proper iterator |
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.
Why? A raw pointer has the benefit of being simple and much, much faster in debug builds
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.
Correct, but it will break down soon once we have strides
What
... and various improvements to
rerun::Collection
in general to be up for the task. Added copy assignment/construction, added vector conversion, removed serialization method (handled at callsites now)Also, I overhauled and generalized our builtin
rerun::CollectionAdapters
further. They give now more exact guarantees on when they copy & move data.To support the considerably increased significance and abilitites of this data structure I added a lot more tests, in particular checking on the aforementioned move/copy guarantees.
Huge thanks to @AnkeAnke for pointing out to me how we can support std compatible contains generically in a trivial way (
rerun::type_traits::value_type_t
!). This made it possible that this PR requires almost no changes in user/test/example code since most types just snap in the same as before.As expected this change improves the performance on the image logging benchmark (which logs 4 16k rgba images).
Timing on M1 Max went from ~2.9s to ~2.4s and on the AMD windows box I use from ~3.0s to ~2.5s
(did a bunch of runs, values are excluding prepare and process setup, AMD fluctuates a lot)
DRAFT until I'm sure this works on more compilers.
Checklist