paulp/scala — comment on commit f6708722593d69a2f68fb91d4605cc1b680a0891
File:  line 0
By paulp:

OK, a 10x slowdown is not what we usually look for in our optimizations. Granted. (Small rewrite takes place.) How about this then.

[info] length benchmark ns linear runtime
[info] 10 Foreach 9.85 =
[info] 10 TFor 5.44 =
[info] 10 While 5.13 =
[info] 100 Foreach 41.84 =
[info] 100 TFor 35.72 =
[info] 100 While 30.29 =
[info] 1000 Foreach 351.74 ===
[info] 1000 TFor 339.31 ==
[info] 1000 While 321.37 ==
[info] 10000 Foreach 3436.13 ==============================
[info] 10000 TFor 3409.29 =============================
[info] 10000 While 3218.88 ============================