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.bugs Subject: bug#13188: Whats' the proper senario of par-map? (Was Re: bug#13188: par-map causes VM stack overflow) Date: Thu, 28 Mar 2013 01:05:32 -0400 Message-ID: <874nfwazc3.fsf__28631.6204387278$1364447229$gmane$org@tines.lan> References: <1355559152.27310.5.camel@Renee-desktop.suse> <87y5d8rclr.fsf@gnu.org> <1364439334.2730.41.camel@Renee-desktop.suse> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364447201 8075 80.91.229.3 (28 Mar 2013 05:06:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Mar 2013 05:06:41 +0000 (UTC) Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , guile-devel@gnu.org, 13188-done@debbugs.gnu.org To: Nala Ginrut Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Thu Mar 28 06:07:08 2013 Return-path: Envelope-to: guile-bugs@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 1UL53H-0004By-Sg for guile-bugs@m.gmane.org; Thu, 28 Mar 2013 06:07:04 +0100 Original-Received: from localhost ([::1]:57127 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL52t-0001C6-PX for guile-bugs@m.gmane.org; Thu, 28 Mar 2013 01:06:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48386) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL52q-0001C0-57 for bug-guile@gnu.org; Thu, 28 Mar 2013 01:06:37 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UL52o-0004lR-Nm for bug-guile@gnu.org; Thu, 28 Mar 2013 01:06:36 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL52o-0004lM-KF for bug-guile@gnu.org; Thu, 28 Mar 2013 01:06:34 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1UL55C-0000Y0-Df for bug-guile@gnu.org; Thu, 28 Mar 2013 01:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Thu, 28 Mar 2013 05:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 13188 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 13188-done@debbugs.gnu.org id=D13188.13644472982051 (code D ref 13188); Thu, 28 Mar 2013 05:09:02 +0000 Original-Received: (at 13188-done) by debbugs.gnu.org; 28 Mar 2013 05:08:18 +0000 Original-Received: from localhost ([127.0.0.1]:48726 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UL54T-0000X2-UA for submit@debbugs.gnu.org; Thu, 28 Mar 2013 01:08:18 -0400 Original-Received: from world.peace.net ([96.39.62.75]:50219) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1UL54R-0000Wt-Aj for 13188-done@debbugs.gnu.org; Thu, 28 Mar 2013 01:08:16 -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 1UL51w-0005Nt-NE; Thu, 28 Mar 2013 01:05:40 -0400 In-Reply-To: <1364439334.2730.41.camel@Renee-desktop.suse> (Nala Ginrut's message of "Thu, 28 Mar 2013 10:55:34 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7019 Archived-At: Nala Ginrut writes: > But I'm still puzzled with the performance of par-map: > --------------------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------------------- > > So my question is, what's the proper scenario to use par-map? It only makes sense to use 'par-map' when the procedure is fairly expensive to compute. There is inevitably a lot of overhead in creating and joining the threads. Granted, we should be able to do much better than we're doing now, but it would *never* make sense to use 'par-map' when each computation is as simple as (expt x 5). Regards, Mark