From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.user Subject: Re: Garbage collector tuning? Date: Thu, 10 Sep 2015 15:30:33 +0200 Message-ID: <87fv2m5rly.fsf@gnu.org> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1441891932 12488 80.91.229.3 (10 Sep 2015 13:32:12 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Sep 2015 13:32:12 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Sep 10 15:32:02 2015 Return-path: Envelope-to: guile-user@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 1Za1xF-0005nh-Sd for guile-user@m.gmane.org; Thu, 10 Sep 2015 15:31:58 +0200 Original-Received: from localhost ([::1]:49280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Za1xA-0005KF-8X for guile-user@m.gmane.org; Thu, 10 Sep 2015 09:31:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Za1wv-0005Gc-NR for guile-user@gnu.org; Thu, 10 Sep 2015 09:31:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Za1wr-00043L-Lp for guile-user@gnu.org; Thu, 10 Sep 2015 09:31:37 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59313) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Za1wr-0003yk-GW for guile-user@gnu.org; Thu, 10 Sep 2015 09:31:33 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Za1wc-0005En-Eb for guile-user@gnu.org; Thu, 10 Sep 2015 15:31:18 +0200 Original-Received: from pluto.bordeaux.inria.fr ([193.50.110.57]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Sep 2015 15:31:18 +0200 Original-Received: from ludo by pluto.bordeaux.inria.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 10 Sep 2015 15:31:18 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: pluto.bordeaux.inria.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 24 Fructidor an 223 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x3D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:iBCXu1toZPKxYT3Hb48lIfyd50A= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 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-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12007 Archived-At: Jan Wedekind skribis: > I wonder whether there is a more performant way to allocate larger > memory blocks (e.g. 1 MByte). "gc-malloc-pointerless" seems to be much > slower than "malloc": > > user system total real > Guile allocate memory 0.003780 0.000020 0.003800 ( 0.003810) > C allocate memory 0.000060 0.000000 0.000060 ( 0.000070) It isn’t fair to compare GC_malloc_pointerless with malloc. Instead, it should be compared with interleaved malloc + free sequences. You should find more on this topic on the home page of libgc, the GC that Guile uses: > Is there a way to control how often the garbage collector is run? The file doc/README.environment in libgc describes some useful environment variables, notably these: GC_INITIAL_HEAP_SIZE= - Initial heap size in bytes. May speed up process start-up. GC_MAXIMUM_HEAP_SIZE= - Maximum collected heap size. GC_MARKERS= - Linux w/threads and parallel marker only. Set the number of marker threads. This is normally set to the number of processors. It is safer to adjust GC_MARKERS than GC_NPROCS, since GC_MARKERS has no impact on the lock implementation. Guile also honors the ‘GC_FREE_SPACE_DIVISOR’ environment variable. See the comments in gc.h for the meaning of this one. HTH, Ludo’.