Skip to content

zerovec slower than cow? #4515

Closed Answered by Manishearth
Thomblin asked this question in Q&A
Jan 5, 2024 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

I don't understand, VarZeroVec<str> is not the equivalent of Cow<str> and String. It's the equivalent of Vec<String> (which cannot be represented in Cow in a way that will not allocate on deserialization).

There's no advantage to using ZeroVec over Cow: ZeroVec supports doing more things in zero-copy. If you can do it in Cow without allocating you don't need this crate.

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by Thomblin
Comment options

You must be logged in to vote
1 reply
@Manishearth
Comment options

Comment options

You must be logged in to vote
1 reply
@Manishearth
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants