Reapply of 31474 with a fix in _compareCocoaBuffer to use the bufferSizeRhs
variable instead of bufferSizeLhs for the right hand side buffer.
We no longer create intermediate NSString copies to compare and hash swift
Strings. Instead we call directly into the ICU library.
I measured a 1.2 to 2x improvement on dictionary benchmarks as a result of this.
The SuperChars benchmark is also about 1.2x faster because of this.
Pure ASCII comparison has gotten a little bit slower (20% on a pure comparison
micro-benchmark) because we no longer do a memcmp. Doing a memcmp on ASCII is
not the same as the default unicode collation. Instead we have to a string scan.
The default unicode collation does not order like ASCII does and ignores
characters (for example the \0 character).
rdar://18992510
Swift SVN r31489
Revert "stdlib: Add back a test I removed"
Revert "Add test cases to exercise the native String vs cocoa buffer String path."
Revert "stdlib: Move the darwin String implementation over to use the ICU library."
This reverts commit r31477, r31476, r31475, r31474.
Commit r31474 broke the ASAN build.
Swift SVN r31488
We no longer create intermediate NSString copies to compare and hash swift
Strings. Instead we call directly into the ICU library.
I measured a 1.2 to 2x improvement on dictionary benchmarks as a result of this.
The SuperChars benchmark is also about 1.2x faster because of this.
Pure ASCII comparison has gotten a little bit slower (20% on a pure comparison
micro-benchmark) because we no longer do a memcmp. Doing a memcmp on ASCII is
not the same as the default unicode collation. Instead we have to a string scan.
The default unicode collation does not order like ASCII does and ignores
characters (for example the \0 character).
rdar://18992510
Swift SVN r31474