From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: =?utf-8?Q?Hans_=C3=85berg?= Newsgroups: gmane.lisp.guile.user Subject: Re: GC thread performance Date: Sat, 2 Dec 2017 00:23:58 +0100 Message-ID: <4FE6EE23-CB67-4058-A981-05F76DCFDA75@telia.com> References: <192F0231-DBB4-40D4-B3D6-0BAAB254CC59@telia.com> <87mv37z4q0.fsf@elektro.pacujo.net> <848C0138-B297-42C2-B45A-562176B88025@telia.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 11.1 \(3445.4.7\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1512170677 11517 195.159.176.226 (1 Dec 2017 23:24:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 1 Dec 2017 23:24:37 +0000 (UTC) Cc: Guile User To: linasvepstas@gmail.com Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Dec 02 00:24:32 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eKufV-0002GW-3l for guile-user@m.gmane.org; Sat, 02 Dec 2017 00:24:29 +0100 Original-Received: from localhost ([::1]:33449 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKufX-00073X-Ao for guile-user@m.gmane.org; Fri, 01 Dec 2017 18:24:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43998) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eKuf7-00073P-EZ for guile-user@gnu.org; Fri, 01 Dec 2017 18:24:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eKuf4-0003c5-4a for guile-user@gnu.org; Fri, 01 Dec 2017 18:24:05 -0500 Original-Received: from v-smtpout2.han.skanova.net ([81.236.60.155]:57475) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eKuf3-0003bG-UB for guile-user@gnu.org; Fri, 01 Dec 2017 18:24:02 -0500 Original-Received: from [10.0.1.4] ([90.227.203.185]) by cmsmtp with SMTP id Kuf0ewz4qAXuLKuf1ej1OV; Sat, 02 Dec 2017 00:23:59 +0100 In-Reply-To: X-Mailer: Apple Mail (2.3445.4.7) X-CMAE-Envelope: MS4wfN5JdAd4lC+yf/bnaeHZxFw0oVhnR0WXXVP1v0vdH3/H1m+SLo1ImgVIEL13rbwxYMcjeyFNCSGFnzmEsIfZ10kesX7Sm2CWhP/bAH6IY0Q5+5TP5Pk/ LHy8YuQcWM6f4NoMz+MoKUS0qljSIEQIys1AsHH+7wB/3Dy0OdcdT44CBa2+jAeP2nWn5ygdQmaBsP1KYDQJjUh2n3BfeTZhhrU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 81.236.60.155 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14307 Archived-At: > On 1 Dec 2017, at 20:49, Linas Vepstas wrote: >=20 > On Mon, Nov 27, 2017 at 5:44 PM, Hans =C3=85berg = wrote: >=20 >>=20 >>=20 >>> On 28 Nov 2017, at 00:23, Marko Rauhamaa wrote: >>>=20 >>> Hans =C3=85berg : >>>> I saw overhead also for the small allocations, 20-30% maybe. This = is >>>> in a program that makes a lot of allocations relative other >>>> computations. So that made me wonder about Guile. >>=20 >=20 > I cannot speak to GC, but I freuqently encounter situations in guile = where > using the parallel constructs e.g. par-for-each, end up running slower = than > the single-threaded version. For example, using 2 or 3 threads, I get = a 2x > and 3x speedup, great, but using 4x gives a slowdown, often 10x slower = than > single-threaded. I try to make sure that the insides of the loop are = large > and long-running, so that the cost of creating and scheduling threads = is > inconsequential. In the program I tested it depends on what I run, but one pattern is = that user time goes up about two times when approaching the hardware = concurrency, and then stabilizes. System time jumps up thirty times when = going from one to two threads, and then further doubles when approaching = the hardware concurrency. > I have not attempted to determine the cause of this, but basically, = that > entire subsystem needs a careful review and measurement. The GC also collects outside the main thread, so if that part takes up = too much system resources, the program itself might too slow down by = that.