From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut 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: Fri, 29 Mar 2013 10:36:50 +0800 Organization: HFG Message-ID: <1364524610.2730.48.camel__1331.28323727778$1364524699$gmane$org@Renee-desktop.suse> References: <1355559152.27310.5.camel@Renee-desktop.suse> <87y5d8rclr.fsf@gnu.org> <1364439334.2730.41.camel@Renee-desktop.suse> <874nfwazc3.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1364524671 30327 80.91.229.3 (29 Mar 2013 02:37:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Mar 2013 02:37:51 +0000 (UTC) Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , guile-devel@gnu.org, 13188-done@debbugs.gnu.org To: Mark H Weaver Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Mar 29 03:38:15 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 1ULPCl-0004Tf-Dj for guile-bugs@m.gmane.org; Fri, 29 Mar 2013 03:38:11 +0100 Original-Received: from localhost ([::1]:54871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULPCN-0002FS-8J for guile-bugs@m.gmane.org; Thu, 28 Mar 2013 22:37:47 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51042) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULPCJ-0002FD-4T for bug-guile@gnu.org; Thu, 28 Mar 2013 22:37:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULPCH-0001uG-7z for bug-guile@gnu.org; Thu, 28 Mar 2013 22:37:43 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULPCH-0001tl-3i for bug-guile@gnu.org; Thu, 28 Mar 2013 22:37:41 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1ULPEg-0002bR-AG for bug-guile@gnu.org; Thu, 28 Mar 2013 22:40:12 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nala Ginrut Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-guile@gnu.org Resent-Date: Fri, 29 Mar 2013 02:40:06 +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.13645247759857 (code D ref 13188); Fri, 29 Mar 2013 02:40:06 +0000 Original-Received: (at 13188-done) by debbugs.gnu.org; 29 Mar 2013 02:39:35 +0000 Original-Received: from localhost ([127.0.0.1]:50313 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ULPE6-0002Yq-J8 for submit@debbugs.gnu.org; Thu, 28 Mar 2013 22:39:35 -0400 Original-Received: from mail-pd0-f180.google.com ([209.85.192.180]:58313) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1ULPE4-0002Yg-B9 for 13188-done@debbugs.gnu.org; Thu, 28 Mar 2013 22:39:33 -0400 Original-Received: by mail-pd0-f180.google.com with SMTP id g10so72493pdj.39 for <13188-done@debbugs.gnu.org>; Thu, 28 Mar 2013 19:36:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:subject:from:to:cc:date:in-reply-to :references:organization:content-type:x-mailer:mime-version :content-transfer-encoding; bh=2sJmLC0vT9xmHgWjWsT0WhRhF0U0neqWcQgk2aaW7ew=; b=s2K3/WF1dmhxqsFq1Mp8oNFALZYK72lnuW5fZUmozFzs3+KxUkE9jaaOUZRfBSQHym FbN9ad1dXbEZg64X7kz7Kx80kyhX6UUYXWlnsUs+YTYv0Ax38vrNN7IL+M/DzbcOn0Ny 2zhAZjgsf7py8fzq4jWIpJlSLkQ3BcxJZCCI7PTYCud7fKGrw7S2x63JUSQCTibC7Qaj qKojyVQfZEV2H9pR2KFgGEeA9qPq1NO4MVBiVBRdnG2CVle20jugF8wFEotAamuJ/013 rxfZPvRGtXymo42mgg8oqSJmXkhbK399bTBAt3k6+Gj/XrNefy8gwnM5ERjEKd7hntWT kucg== X-Received: by 10.66.43.244 with SMTP id z20mr1989786pal.200.1364524617849; Thu, 28 Mar 2013 19:36:57 -0700 (PDT) Original-Received: from [147.2.147.112] ([61.14.130.226]) by mx.google.com with ESMTPS id z1sm996446pbw.19.2013.03.28.19.36.55 (version=SSLv3 cipher=RC4-SHA bits=128/128); Thu, 28 Mar 2013 19:36:56 -0700 (PDT) In-Reply-To: <874nfwazc3.fsf@tines.lan> X-Mailer: Evolution 3.4.4 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:7024 Archived-At: On Thu, 2013-03-28 at 01:05 -0400, Mark H Weaver wrote: > 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). > Well, is there any example? And there're two possible applications: 1. handle the requests in a server 2. read files from disk (but how big file is proper for par-map) Are these ways heavy enough for par-map? Potentially, I inclined to use the lovely delimited-continuation to handle the requests, but seems ludo think this way is slower? Or there's improvement room? > Regards, > Mark