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

feature: Immutable shared version of CompactStr? #80

Open
NobodyXu opened this issue Apr 4, 2022 · 0 comments
Open

feature: Immutable shared version of CompactStr? #80

NobodyXu opened this issue Apr 4, 2022 · 0 comments

Comments

@NobodyXu
Copy link
Contributor

NobodyXu commented Apr 4, 2022

Having a mutable CompactStr is great since it can be a drop-in replacement of String.

However, the original immutable CompactStr provides O(1) clone, which is super useful for immutable string, which is also super useful.

One of the issue with immutable CompactStr is that it makes #16 harder without performance penalty, as std::sync::Arc does not have stable API for MaybeUninit.

But that can be solved with triomphe::Arc as it provides new_uninit_slice methods for creating an uninitialized slice, which makes implementation of #16 possible without any performance penalty.

Also triomphe::Arc is 8 bytes smaller than std::sync::Arc, as it does not support weak reference, which is not used in this crate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant