-
Notifications
You must be signed in to change notification settings - Fork 43
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 indexmap
for TxtProperties
#300
Comments
Something like If any real world use case (or measurements) shows that |
I agree with your analysis. The number of As personal use-case, I need to convert As it is now, we need to allocate Here an example of how I'm doing that right now. info.get_properties()
.iter()
.map(|v| (v.key().to_string(), v.val_str().to_string()))
.collect() |
I think we can add a new method for such cases. I've opened a draft PR #303 based on my understanding. Please let me know if that would work for you. |
PR merged. Thanks! |
I was just looking at these code lines and I've thought that the indexmap collection would be efficient for
TxtProperties
's use-cases.Advantages:
TxtProperty
cannot be removed from the collection, but only read. This would always respect the insertion order. I've based my assumption from the methods provided by this structure thoughHashMap
in terms of performanceDisadvantages:
It would also be helpful to provide a method to access the internal
indexmap
The text was updated successfully, but these errors were encountered: