From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut 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 10:36:50 +0800 Organization: HFG Message-ID: <1364524610.2730.48.camel@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 1364524655 30207 80.91.229.3 (29 Mar 2013 02:37:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 Mar 2013 02:37:35 +0000 (UTC) Cc: Ludovic =?ISO-8859-1?Q?Court=E8s?= , 13188-done@debbugs.gnu.org, guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Mar 29 03:38:02 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 1ULPCa-0003oT-E0 for guile-devel@m.gmane.org; Fri, 29 Mar 2013 03:38:00 +0100 Original-Received: from localhost ([::1]:54705 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULPCC-00029r-23 for guile-devel@m.gmane.org; Thu, 28 Mar 2013 22:37:36 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:50868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULPBe-0001YN-3B for guile-devel@gnu.org; Thu, 28 Mar 2013 22:37:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULPBd-0001f6-0Q for guile-devel@gnu.org; Thu, 28 Mar 2013 22:37:02 -0400 Original-Received: from mail-pd0-f172.google.com ([209.85.192.172]:40618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULPBb-0001en-Eg; Thu, 28 Mar 2013 22:36:59 -0400 Original-Received: by mail-pd0-f172.google.com with SMTP id w10so72702pde.17 for ; 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-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.192.172 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:16051 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