Extract pub const NAME for all array encoding structs#6990
Closed
jiaqizho wants to merge 1 commit intovortex-data:developfrom
Closed
Extract pub const NAME for all array encoding structs#6990jiaqizho wants to merge 1 commit intovortex-data:developfrom
jiaqizho wants to merge 1 commit intovortex-data:developfrom
Conversation
Add a `pub const NAME: &str` to every array encoding struct and derive `pub const ID: ArrayId` from `Self::NAME` instead of an inline string literal. This eliminates duplicated encoding name strings and gives external code a stable constant to reference when matching on encoding IDs. Signed-off-by: jiaqizho <jiaqi.zhou@zilliz.com>
gatesn
requested changes
Mar 17, 2026
Contributor
gatesn
left a comment
There was a problem hiding this comment.
I'm not sure I understand the goal here? Why is there duplicate strings in the existing world but not in the new world?
Contributor
|
Was there a reason for this change in relation to #6974? I think I still personally like this change but the reasoning isn't super clear here, where are the duplicated strings in the current codebase? |
Merging this PR will improve performance by 18.36%
Performance Changes
Comparing Footnotes
|
Author
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.
Summary
Add a
pub const NAME: &strto every array encoding struct and derivepub const ID: ArrayIdfromSelf::NAMEinstead of an inline string literal. This eliminates duplicated encoding name strings and gives external code a stable constant to reference when matching on encoding IDs.relative to #6974
Testing
N/A