Repository navigation
Optimize immutable id tracker mapping - #6023
Merged
Merged
Conversation
generall
force-pushed
the
optimize-immutable-id-tracker-mapping
branch
from
February 20, 2025 09:30
7156e5a to
16e88b9
Compare
timvisee
reviewed
Feb 20, 2025
Comment on lines
+102
to
+103
| let mut external_to_internal_num: Vec<(u64, PointOffsetType)> = Vec::new(); | ||
| let mut external_to_internal_uuid: Vec<(Uuid, PointOffsetType)> = Vec::new(); |
Member
There was a problem hiding this comment.
I consider overallocating here once better than having to reallocate a few times.
Suggested change
| let mut external_to_internal_num: Vec<(u64, PointOffsetType)> = Vec::new(); | |
| let mut external_to_internal_uuid: Vec<(Uuid, PointOffsetType)> = Vec::new(); | |
| let mut external_to_internal_num: Vec<(u64, PointOffsetType)> = Vec::with_capacity(len); | |
| let mut external_to_internal_uuid: Vec<(Uuid, PointOffsetType)> = Vec::with_capacity(len); |
Member
Author
There was a problem hiding this comment.
my logic was that only one of them actually filled, so didn't want to allocate more memory on start than needed
| deleted: BitVec, | ||
| internal_to_external: CompressedInternalToExternal, | ||
| external_to_internal: CompressedExternalToInternal, | ||
| ) -> Self { |
Member
There was a problem hiding this comment.
We must enforce the size of deleted here, since this structure does not support dynamically sized deleted flags currently.
PointMappings is an example of where the deleted flags can have a different size:
// It is possible that `deleted` can be longer or shorter than `internal_to_external`.
// - if `deleted` is longer, then extra bits should be set to `false` and ignored.
deleted: BitVec,
I'll add an explicit resize for now to prevent that problem. We can do that since we own the types here.
timvisee
force-pushed
the
optimize-immutable-id-tracker-mapping
branch
from
February 20, 2025 12:44
16e88b9 to
e330add
Compare
timvisee
force-pushed
the
optimize-immutable-id-tracker-mapping
branch
from
February 20, 2025 12:46
e330add to
cb93323
Compare
timvisee
added a commit
that referenced
this pull request
Mar 21, 2025
* clone PointMappings into CompressedPointMappings * fmt * compressed internal to external * implement compressed external to internal mapping * some autogenerated tests * fix test * Explicitly resize deleted flags, ensure length matches number of points * Review remarks --------- Co-authored-by: timvisee <[email protected]>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.