From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.devel Subject: Re: Whats' the proper senario of par-map? (Was Re: bug#13188: par-map causes VM stack overflow) Date: Fri, 29 Mar 2013 12:45:18 -0400 Message-ID: <87ppyi889t.fsf@tines.lan> References: <1355559152.27310.5.camel@Renee-desktop.suse> <87y5d8rclr.fsf@gnu.org> <1364439334.2730.41.camel@Renee-desktop.suse> <874nfwazc3.fsf@tines.lan> <1364524610.2730.48.camel@Renee-desktop.suse> <87d2uiah6h.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364575542 25978 80.91.229.3 (29 Mar 2013 16:45:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Mar 2013 16:45:42 +0000 (UTC) Cc: guile-devel@gnu.org To: Nala Ginrut Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 29 17:46:09 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ULcRL-0005En-R9 for guile-devel@m.gmane.org; Fri, 29 Mar 2013 17:46:07 +0100 Original-Received: from localhost ([::1]:45932 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULcQx-0001ok-GP for guile-devel@m.gmane.org; Fri, 29 Mar 2013 12:45:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULcQs-0001oX-6W for guile-devel@gnu.org; Fri, 29 Mar 2013 12:45:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULcQn-0003qx-FW for guile-devel@gnu.org; Fri, 29 Mar 2013 12:45:38 -0400 Original-Received: from world.peace.net ([96.39.62.75]:54125) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULcQn-0003qp-BA for guile-devel@gnu.org; Fri, 29 Mar 2013 12:45:33 -0400 Original-Received: from 209-6-91-212.c3-0.smr-ubr1.sbo-smr.ma.cable.rcn.com ([209.6.91.212] helo=tines.lan) by world.peace.net with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1ULcQg-0002Y4-DG; Fri, 29 Mar 2013 12:45:26 -0400 In-Reply-To: <87d2uiah6h.fsf@tines.lan> (Mark H. Weaver's message of "Fri, 29 Mar 2013 01:49:58 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 96.39.62.75 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:16056 Archived-At: I wrote: > Nala Ginrut 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). BTW, I notice that the overhead of 'par-map' is much less for shorter lists. It's about 9 times faster for lists of length 1000, and about 20 times faster for lists of length 100. --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,time (define a (par-map (lambda (x) (expt x 5)) (iota 10000))) ;; 8.293139s real time, 8.281802s run time. 1.310634s spent in GC. scheme@(guile-user)> ,time (define a (for-each (lambda (k) (par-map (lambda (x) (expt x 5)) (iota 1000))) (iota 10))) ;; 0.908630s real time, 0.916819s run time. 0.070018s spent in GC. scheme@(guile-user)> ,time (define a (for-each (lambda (k) (par-map (lambda (x) (expt x 5)) (iota 100))) (iota 100))) ;; 0.330130s real time, 0.418148s run time. 0.045255s spent in GC. --8<---------------cut here---------------end--------------->8--- Mark