Ignore:
Timestamp:
Jun 1, 2009, 11:41:20 AM (16 years ago)
Author:
[email protected]
Message:

JavaScriptCore:

2009-06-01 David Levin <[email protected]>

Reviewed by Darin Alder and Maciej Stachowiak.

Bug 26057: StringImpl should share buffers with UString.
https://bugs.webkit.org/show_bug.cgi?id=26057

  • JavaScriptCore.exp:
  • runtime/UString.cpp: (JSC::UString::Rep::create): (JSC::UString::BaseString::sharedBuffer): Only do the sharing when the buffer exceeds a certain size. The size was tuned by running various dom benchmarks with numbers ranging from 20 to 800 and finding a place that seemed to do the best overall.
  • runtime/UString.h:

WebCore:

2009-06-01 David Levin <[email protected]>

Reviewed by Darin Alder and Maciej Stachowiak.

Bug 26057: StringImpl should share buffers with UString.
https://bugs.webkit.org/show_bug.cgi?id=26057

This change results in the following performance improvements:
On http://www.hixie.ch/tests/adhoc/perf/dom/artificial/core/001.html
the time went from 78ms to 40ms for append (other times remained constant).

On http://www.hixie.ch/tests/adhoc/perf/dom/artificial/core/002.html,
the time went from 3900ms to 2600ms.

For http://dromaeo.com/?dom, the time for DomModification improved by ~6%.
Other tests in dom seemed to be faster across several runs but within the
margin of error (except DOM Attributes which was slightly ~1.5% worse).

Existing tests cover this code and there is no new functionality
that is exposed to test.

  • platform/text/AtomicString.cpp: (WebCore::AtomicString::add):
  • platform/text/String.cpp: (WebCore::String::String): (WebCore::String::operator UString):
  • platform/text/StringImpl.cpp: (WebCore::StringImpl::StringImpl): (WebCore::StringImpl::~StringImpl): (WebCore::StringImpl::create): Consumes a shared buffer. (WebCore::StringImpl::ustring): Shares the StringImpl's buffer with the UString. (WebCore::StringImpl::sharedBuffer): Exposes the buffer that may be shared.
  • platform/text/StringImpl.h: (WebCore::StringImpl::hasTerminatingNullCharacter): (WebCore::StringImpl::inTable): (WebCore::StringImpl::setInTable): Converted the bools to be inside of PtrAndFlags to avoid growing StringImpl in size.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/JavaScriptCore.exp

    r44171 r44325  
    218218__ZN3JSC7Profile7excludeEPKNS_11ProfileNodeE
    219219__ZN3JSC7Profile7forEachEMNS_11ProfileNodeEFvvE
     220__ZN3JSC7UString10BaseString12sharedBufferEv
    220221__ZN3JSC7UString3Rep11computeHashEPKci
    221222__ZN3JSC7UString3Rep11computeHashEPKti
    222223__ZN3JSC7UString3Rep14nullBaseStringE
     224__ZN3JSC7UString3Rep6createEPtiN3WTF10PassRefPtrINS3_21CrossThreadRefCountedINS3_16OwnFastMallocPtrItEEEEEE
    223225__ZN3JSC7UString3Rep7destroyEv
    224226__ZN3JSC7UString4fromEi
Note: See TracChangeset for help on using the changeset viewer.