Open decathorpe opened 1 year ago
Note: https://github.com/rust-lang/rust/issues/105371
Seems that for rustc 1.65 and 1.66 std::borrow::Cow
indeed has become smaller (24 bytes), but in 1.67 it is back to 32 bytes, as result of an optimization for enums which in some cases causes regressions such as this one.
I've been a bit out of the loop for a while, and so I've missed this completely. That optimization being present renders beef pretty much obsolete, though given it's regressed there isn't much for me to do now :upside_down_face:.
I'll leave this issue open for posterity, and in case this gets changed back in std
can just put a deprecation info on the crate.
That optimization being present renders beef pretty much obsolete
I don't think that is entirely true; at the very least the lean version will remain worthwhile even when the regression is fixed.
Also, I think that beef::lean:Cow
might work vey nicely together with, for instance, rkyv
, since both (by default) optimize space and performance by limiting their content length to 2^32.
As of Rust 1.65.0, many enums are now smaller, probably because of this new optimization: https://github.com/rust-lang/rust/pull/94075
So as of Rust 1.65.0,
std::borrow::Cow
is 24 bytes in size, same asbeef::Cow
(at least on 64-bit architectures, I haven't checked 32-bit architectures).