Nov. 13, 2009
10 a.m.
On Nov 13, 2009, at 10:05 AM, Peter Hugosson-Miller wrote:
Results for VisualAge (just FYI):
| count | count := 0. [1 to: 10000000 do: [:i | count :=count + 1]] timeToRun. "151702"
| count | count := 0. [10000000 timesRepeat: [count := count + 1]] timeToRun. "139971"
(results are in microseconds)
So maybe there's a case for inlining #timesRepeat: (or making a clear comment that it is much slower in Pharo)
In general inlining is evil ;-) timesRepeat for the special case of being send to an int, detected statically... maybe I could be convinced of that. But in general, what would be much nicer would be to do it based on type-feedback information nicely hidden so nobody sees it. Marcus