stdlib: improve performance of string appending

CaptureProp ,  -21.8%
             HeapSort ,   12.7%
            ImageProc ,  -25.6%
               StrCat ,   92.6%
       StrComplexWalk ,   11.1%
             StrToInt ,   16.6%
  StringInterpolation ,   21.6%

Regression in CaptureProp is due to some interference of the harness.  When the
code is extracted into a separate file, there is no difference.

Regression in ImageProc is caused by unconditional construction of a string for
CheckResults()

rdar://18119872

Swift SVN r21535
This commit is contained in:
Dmitri Hrybenko
2014-08-28 16:48:39 +00:00
parent 4098c9a267
commit 985def47c9
2 changed files with 6 additions and 1 deletions

View File

@@ -300,7 +300,7 @@ public func += (inout lhs: String, rhs: String) {
lhs = rhs
}
else {
lhs._core.extend(rhs._core)
lhs._core.append(rhs._core)
}
}