Re: [racket] performance tuning summing a hash of vectors

2012-03-14 Thread Marijn
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13-03-12 17:34, Matthias Felleisen wrote: > > 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 >

Re: [racket] performance tuning summing a hash of vectors

2012-03-13 Thread Matthias Felleisen
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)) ;;

[racket] performance tuning summing a hash of vectors

2012-03-13 Thread Marijn
Hi, a program I'm working on uses hashes of vectors to organize data. The vectors are the same length and need to be summed over the hash keys. The obvious solution uses a double for loop: one for the keys of the hash and one over the vector indices. Thinking about it I decided that the most effic