Hi there,
it's a little less than a year ago the above issue has been raised
by Uko [1]. I run some benchmarks (a little less than year ago :-)
With the integration of QA this issue may deserve some attention again.
Besides, Uko asked for a feedback.
The rule seems to be wrong - it barks on code which is (seems to be)
perfectly fine performance-wise, For example:
shutUp
Class allInstances do:[:cls |
Transcript show: 'barking at' , cls name
]
See *some* of the benchmark results:
http://bit.ly/1GnZ3K0My interpretation of the result is the following:
For small number of concatenations, i.e., up to 5, with no
accumulator and with reasonably small strings, i.e., shorter than
50 bytes,
it's actually faster to use string concatenation.
Using streams is slower, unless one preallocates stream backing
string to exactly the size needed. In that case, it's roughly the
same as string concatenation using #,
You may find full benchmark data at:
https://swing.fit.cvut.cz/calipel/archive/943.jsonhttps://swing.fit.cvut.cz/calipel/archive/944.jsonBenchmark source:
https://bitbucket.org/janvrany/jv-calipel/src/tip/s/benchmarks/micro/BenchmarkMicroStringConcat.st?fileviewer=file-view-default
https://bitbucket.org/janvrany/jv-calipel/src/tip/s/benchmarks/micro/BenchmarkMicroStringConcatN.st?fileviewer=file-view-default
Indeed, I could have messed up things - we all know about
lies, damn lies and benchmarks.
HTH, Jan
[1]:
http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/2014-November/103162.html