I was hoping to discuss some UString/StringImpl changes with someone
familiar with this area.
My goals were
- be able to share a UString across threads without doing any memory
copies.
- do not increase the size of UString/StringImpl
- make their performance no worse in the common case (as measured by
SunSpider).
- be able to create a String from a UString without allocations and
copying a new buffer for the underlying string (I heard that this was
desired.)
My change seems to make SunSpider run about *1-2% faster *and use the *same
or less memory *for UString. For an extreme example, SmallStringStorage
went from ~13K to ~7k.
I would like to ensure that this approach seems ok (and get
some initial feedback). Here's the patch so far:
http://pastebin.com/m4fdac1d6
One issue: (As ap suggested to me), I think my String::String(UString&)
change is incorrect. The shared ownership of the underlying point should
probably be the result of an explicit parameter to a String constructor.
Thanks,
Dave
PS In case you're wondering what happened as a result of my last emails.
This change is to support the "inspector calls from XHR running in a
(html5) worker".
PPS I didn't file a bug for this yet because I felt like this change was
still a bit in the design phase (rather than patch ready phase). If a bug
is the right way to go at this early-ish stage. I can do that in the future.
_______________________________________________
webkit-dev mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev