[PATCH 1/4] jscript: Use custom string container instead of BSTR.

Jacek Caban jacek at codeweavers.com
Fri Oct 12 04:11:31 CDT 2012

On 10/11/12 19:12, Charles Davis wrote:
> On Oct 11, 2012, at 4:16 AM, Jacek Caban wrote:
>> This patch alone makes SunSpider 0.9 17x faster.
> Seems to me that something is really wrong with our BSTR implementation if replacing it with a home-grown implementation speeds this up by a factor of 17.

Not really, BSTR is just not the right tool in this case. BSTR is mostly
just an allocator that also stores string length, but limits what you
can do with it (eg. if you want to store substring as BSTR, a
reallocation is needed). We used it in jscript mainly for historical
reason. Strings handling is very important part of script engines and
it's obvious that custom implementation is better. BTW, this patch is
just beginning for string optimization. Things like atoms, lazy
concatenation and dependent strings are still left to do.


More information about the wine-devel mailing list