For what it is worth, Gecko uses a single-entry per-zone cache for
converting the result of JS strings to DOM strings in getAttribute (I
think). bz added this in bug 773520, and it has had a few refinements since
then. Maybe some kind of caching would help Servo, too.

Andrew

On Wed, Dec 2, 2015 at 1:05 PM, Alan Jeffrey <ajeff...@mozilla.com> wrote:

> Well, I tried eliminating the buffering, but I still didn't get any perf
> benefit, if anything there was a degrade. Sigh.
>
>
> https://github.com/asajeffrey/servo/commit/1533238eb8ffff22688572a04d5bd6eb8ac88297
>
> On Wed, Dec 2, 2015 at 10:49 AM, Nick Fitzgerald <nfitzger...@mozilla.com>
> wrote:
>
> > And there is also ArrayString[0] from the arrayvec crate[1]. I was
> > considering reusing this and getting rid of the fixed size
> `InlineString` I
> > rolled myself as ArrayString is almost identical.
> >
> > [0] http://bluss.github.io/arrayvec/doc/arrayvec/struct.ArrayString.html
> > [1] https://crates.io/crates/arrayvec
> >
> > On Tue, Dec 1, 2015 at 6:03 PM, Simon Sapin <simon.sa...@exyr.org>
> wrote:
> >
> > > On 02/12/15 02:39, Nick Fitzgerald wrote:
> > >
> > >> I've created a crate[0] that provides a mostly drop-in replacement of
> > >> std::string::String but with inline storage for small strings to avoid
> > >> heap
> > >> allocation.
> > >>
> > >> [0]https://github.com/fitzgen/inlinable_string
> > >>
> > >
> > > There’s also [1], already in used in Servo in some places, which
> behaves
> > > like Vec<T> but stores items inline up to a certain length. I’ve also
> > been
> > > playing with [2] to be like String but with a generic backing storage.
> > > (I’ve used it in [3] to return a single code point in UTF-8 as
> > > StringWrapper<[u8; 4]>.)
> > >
> > > Would it make sense to converge with some of these?
> > >
> > > [1] https://github.com/servo/rust-smallvec
> > > [2]
> > >
> >
> https://github.com/SimonSapin/rust-std-candidates/blob/master/string-wrapper/lib.rs
> > > [3] https://github.com/SimonSapin/rust-utf8
> > >
> > >
> > > --
> > > Simon Sapin
> > >
> > > _______________________________________________
> > > dev-servo mailing list
> > > dev-servo@lists.mozilla.org
> > > https://lists.mozilla.org/listinfo/dev-servo
> > >
> > _______________________________________________
> > dev-servo mailing list
> > dev-servo@lists.mozilla.org
> > https://lists.mozilla.org/listinfo/dev-servo
> >
> _______________________________________________
> dev-servo mailing list
> dev-servo@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-servo
>
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to