Ignore:
Timestamp:
Feb 1, 2011, 2:03:04 PM (15 years ago)
Author:
Patrick Gansterer
Message:

2011-02-01 Patrick Gansterer <Patrick Gansterer>

Reviewed by Darin Adler.

Avoid strlen() in AtomicString::fromUTF8
https://bugs.webkit.org/show_bug.cgi?id=50516

Add an overload to calculateStringHashFromUTF8 to get
strlen() of the input data with only one call.

This change shows about 3% performance win on the xml-parser benchmark.

  • JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
  • wtf/text/AtomicString.cpp: (WTF::AtomicString::fromUTF8):
  • wtf/unicode/UTF8.cpp: (WTF::Unicode::calculateStringHashAndLengthFromUTF8Internal): (WTF::Unicode::calculateStringHashFromUTF8): (WTF::Unicode::calculateStringHashAndLengthFromUTF8):
  • wtf/unicode/UTF8.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r77287 r77297  
     12011-02-01  Patrick Gansterer  <[email protected]>
     2
     3        Reviewed by Darin Adler.
     4
     5        Avoid strlen() in AtomicString::fromUTF8
     6        https://bugs.webkit.org/show_bug.cgi?id=50516
     7
     8        Add an overload to calculateStringHashFromUTF8 to get
     9        strlen() of the input data with only one call.
     10
     11        This change shows about 3% performance win on the xml-parser benchmark.
     12
     13        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def:
     14        * wtf/text/AtomicString.cpp:
     15        (WTF::AtomicString::fromUTF8):
     16        * wtf/unicode/UTF8.cpp:
     17        (WTF::Unicode::calculateStringHashAndLengthFromUTF8Internal):
     18        (WTF::Unicode::calculateStringHashFromUTF8):
     19        (WTF::Unicode::calculateStringHashAndLengthFromUTF8):
     20        * wtf/unicode/UTF8.h:
     21
    1222011-02-01  Sam Weinig  <[email protected]>
    223
Note: See TracChangeset for help on using the changeset viewer.