Ignore:
Timestamp:
Nov 13, 2007, 12:05:03 AM (18 years ago)
Author:
[email protected]
Message:

Reviewed by Sam Weinig.


Fixed http://bugs.webkit.org/show_bug.cgi?id=15958
base64 spends 1.1% of total time checking for special Infinity case


Use a fast character test instead of calling strncmp.


1.1% speedup on string-base64. SunSpider reports a .4% speedup overall;
Sharks reports only .1%. Who are you going to believe? Huh?

  • kjs/ustring.cpp: (KJS::UString::toDouble):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/ustring.cpp

    r27746 r27748  
    10021002      // whereas the ECMA spec requires that it be converted to NaN.
    10031003
    1004       if (strncmp(c, "Infinity", 8) == 0) {
     1004      if (c[0] == 'I' && c[1] == 'n' && c[2] == 'f' && c[3] == 'i' && c[4] == 'n' && c[5] == 'i' && c[6] == 't' && c[7] == 'y') {
    10051005        d = sign * Inf;
    10061006        c += 8;
Note: See TracChangeset for help on using the changeset viewer.