Nala Ginrut <nalagin...@gmail.com> writes: > --------------------cut------------------- > scheme@(guile-user)> ,time (define a (map (lambda (x) (expt x 5)) (iota > 10000))) > ;; 0.008019s real time, 0.007979s run time. 0.000000s spent in GC. > scheme@(guile-user)> ,time (define a (par-map (lambda (x) (expt x 5)) > (iota 10000))) > ;; 6.596471s real time, 6.579375s run time. 1.513880s spent in GC. > --------------------end------------------- [...] > Well, is there any example?
The timings above suggest that, on your machine, the overhead of 'par-map' is in the neighborhood of 660 microseconds per thread (that's the total run time divided by 10000 iterations). So if the procedure takes significantly longer than that to run, the overhead will not be so bad. For example, if the procedure takes 10 milliseconds to run, then the 'par-map' overhead would be about 6.6% (660/10000). If the procedure takes 100 milliseconds to run, then the overhead would be about 0.6% (660/100000). That's the way I'd suggest to think about it. Mark