[rust-dev] In favor of types of unknown size
pwalton at mozilla.com
Sat Apr 28 03:45:20 PDT 2012
On 04/28/2012 03:17 AM, Matthieu Monrocq wrote:
> I would also like to point out that if it's an implementation detail,
> the actual representation might vary from known size to unknown size
> without impact for the user, so starting without for the moment because
> it's easier and refining it later is an option. Another option is to
> have a fixed size with an alternative representation using something
> similar to SSO (Short String Optimization); that is small
> vectors/strings allocate their storage in place while larger ones push
> their storage to the heap to avoid trashing the stack.
We tried this once. It was a disaster in terms of code size; you really
don't want all strings and vectors doing this.
More information about the Rust-dev