Changes between Version 7 and Version 8 of EfficientStrings


Ignore:
Timestamp:
Aug 29, 2012 6:18:53 PM (10 years ago)
Author:
benjamin@webkit.org
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • EfficientStrings

    v7 v8  
    77 * '''String foo = ASCIILiteral("bar")''';
    88 * String foo("bar", String::ConstructFromLiteral);
    9  * AtomicString foo("bar", AtomicString::ConstructFromLiteral);
    109
    1110The safest option is ''ASCIILiteral("Foo")''. It produces the same code size as String("Foo") while being faster.
     
    1312The difference between the version is if the length of the string is included or not. Having the size given in the constructor makes the constructor faster. Having the size also makes the code bigger, which is a problem when the code is executed infrequently.[[BR]][[BR]]
    1413In general, use ASCIILiteral unless you can show improvement on a benchmark by using ConstructFromLiteral.
     14
     15==== AtomicString from literal ====
     16AtomicString should always use the full template version:
     17 * AtomicString foo("bar", AtomicString::ConstructFromLiteral);
     18
     19The reason is that version gives the possibility to compute the hash at compile time in the future.
    1520
    1621==== Not creating a string ====
     
    2328
    2429The first version is the fastest.
    25 
    2630
    2731=== Concatenation ===