On Fri, 22 Aug 2014 17:52:57 -0700, Kevin Wortman <[email protected]> said: > ...
> IMO, small constant-factor costs, like > the time to initialize an array, are not > a big concern in Scheme code. For > reference, a quick test shows my 2 year > old laptop can memset approx. 3.7 > GB/sec. So this cost is almost certainly > dominated by other factors. In cases > where this kind of thing makes a > user-visible make-or-break difference, > I'd probably need to be write assembly or > low-level C anyway. So I prefer for > Scheme code to do the Right Thing even at > the expense of some small constant > factors here and there. I would not go so > far as to say there is broad consent to > this position. I agree with the spirit of this statement. Nevertheless, I can't resist making a pedantic note. The rate given above, 3.7 GB/s, is on the order of 1 word/ns; in other words, initializing a million-element vector would take on the order of a million CPU cycles. This might be significant in the proverbial inner loop. In other words, your CPUage will indeed vary... ---Vassil. -- Vassil Nikolov | Васил Николов | <[email protected]> "Be careful how you fix what you don't understand." (Brooks 2010, 185) _______________________________________________ Scheme-reports mailing list [email protected] http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports
