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 01:49:58 -0400 Message-ID: <87d2uiah6h.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> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364536226 22986 80.91.229.3 (29 Mar 2013 05:50:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Mar 2013 05:50:26 +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 06:50:53 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 1ULSDD-0004AU-QP for guile-devel@m.gmane.org; Fri, 29 Mar 2013 06:50:51 +0100 Original-Received: from localhost ([::1]:44456 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULSCp-00047i-I3 for guile-devel@m.gmane.org; Fri, 29 Mar 2013 01:50:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULSCm-00047L-Hv for guile-devel@gnu.org; Fri, 29 Mar 2013 01:50:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULSCl-0006EC-GN for guile-devel@gnu.org; Fri, 29 Mar 2013 01:50:24 -0400 Original-Received: from world.peace.net ([96.39.62.75]:53668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULSCl-0006Da-CF for guile-devel@gnu.org; Fri, 29 Mar 2013 01:50:23 -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 1ULSCT-0000qx-UC; Fri, 29 Mar 2013 01:50:06 -0400 In-Reply-To: <1364524610.2730.48.camel@Renee-desktop.suse> (Nala Ginrut's message of "Fri, 29 Mar 2013 10:36:50 +0800") 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:16052 Archived-At: 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). 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