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: Thu, 28 Mar 2013 01:05:32 -0400 Message-ID: <874nfwazc3.fsf@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 1364447166 7779 80.91.229.3 (28 Mar 2013 05:06:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Mar 2013 05:06:06 +0000 (UTC) Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , 13188-done@debbugs.gnu.org, guile-devel@gnu.org To: Nala Ginrut Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Mar 28 06:06:32 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 1UL52h-0002EM-Vm for guile-devel@m.gmane.org; Thu, 28 Mar 2013 06:06:28 +0100 Original-Received: from localhost ([::1]:56942 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL52J-000148-Sa for guile-devel@m.gmane.org; Thu, 28 Mar 2013 01:06:03 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:48221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL52F-00013s-K9 for guile-devel@gnu.org; Thu, 28 Mar 2013 01:06:00 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UL52D-0004ef-Pg for guile-devel@gnu.org; Thu, 28 Mar 2013 01:05:59 -0400 Original-Received: from world.peace.net ([96.39.62.75]:52432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL52D-0004b0-JO; Thu, 28 Mar 2013 01:05:57 -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-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:16044 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