[racket] performance tuning summing a hash of vectors
On Mar 13, 2012, at 12:05 PM, Marijn wrote:
> (define (sum-hash-of-vectors3 table keys size)
> (apply vector-map +
> (for/list ((k keys))
> (hash-ref table k))))
Aren't the last two lines just
(hash-map table (lambda (key table) table))
;; -------------------------------------------
When it comes to performance, always try to trust the compiler first.
It was eons ago that we had much intuition of how to turn code into
machine instructions, and how much these instructions would cost. This
is even true for C now (think pipelines, memory hierarchies, etc).