Changes between Version 7 and Version 8 of EfficientStrings
- Timestamp:
- Aug 29, 2012, 6:18:53 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
EfficientStrings
v7 v8 7 7 * '''String foo = ASCIILiteral("bar")'''; 8 8 * String foo("bar", String::ConstructFromLiteral); 9 * AtomicString foo("bar", AtomicString::ConstructFromLiteral);10 9 11 10 The safest option is ''ASCIILiteral("Foo")''. It produces the same code size as String("Foo") while being faster. … … 13 12 The 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]] 14 13 In general, use ASCIILiteral unless you can show improvement on a benchmark by using ConstructFromLiteral. 14 15 ==== AtomicString from literal ==== 16 AtomicString should always use the full template version: 17 * AtomicString foo("bar", AtomicString::ConstructFromLiteral); 18 19 The reason is that version gives the possibility to compute the hash at compile time in the future. 15 20 16 21 ==== Not creating a string ==== … … 23 28 24 29 The first version is the fastest. 25 26 30 27 31 === Concatenation ===