From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: [BDW-GC] Performance impact of static allocation Date: Wed, 02 Sep 2009 02:24:05 +0200 Message-ID: <87vdk242je.fsf@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-Trace: ger.gmane.org 1251851092 31958 80.91.229.12 (2 Sep 2009 00:24:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 2 Sep 2009 00:24:52 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Wed Sep 02 02:24:45 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MideX-0003Jd-AU for guile-devel@m.gmane.org; Wed, 02 Sep 2009 02:24:45 +0200 Original-Received: from localhost ([127.0.0.1]:51896 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MideW-0006Mp-2j for guile-devel@m.gmane.org; Tue, 01 Sep 2009 20:24:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MideT-0006MX-2d for guile-devel@gnu.org; Tue, 01 Sep 2009 20:24:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MideO-0006IW-HG for guile-devel@gnu.org; Tue, 01 Sep 2009 20:24:40 -0400 Original-Received: from [199.232.76.173] (port=41520 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MideO-0006IP-AC for guile-devel@gnu.org; Tue, 01 Sep 2009 20:24:36 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:45748) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MideN-0003r6-Ik for guile-devel@gnu.org; Tue, 01 Sep 2009 20:24:36 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.50) id 1MideJ-0003GJ-CM for guile-devel@gnu.org; Wed, 02 Sep 2009 02:24:31 +0200 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Sep 2009 02:24:31 +0200 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 02 Sep 2009 02:24:31 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 86 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 16 Fructidor an 217 de la =?iso-8859-1?Q?R=E9volutio?= =?iso-8859-1?Q?n?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 821D 815D 902A 7EAB 5CEE D120 7FBA 3D4F EB1F 5364 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:0dptvNQKg3Cq9QA0Q6zGswd9Xl4= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:9247 Archived-At: --=-=-= Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello! I just updated the `bdw-gc-static-alloc' branch [0]. It statically allocates stringbufs, strings, and subrs defined using the "snarfing macros". It links `libguile' with `-z relro' such that constants needing relocation are placed in a `PT_GNU_RELRO' ELF segment, which is made read-only by the dynamic linker after relocation. Current libgc CVS (pre-7.2) is aware of `PT_GNU_RELRO' [1,=A02] and does not scan data contained in this segment (since it cannot possibly contain pointers to heap-allocated objects). This was not the case in 7.1. Thus I compared `bdw-gc-static-alloc' to `boehm-demers-weiser-gc' using the latest libgc. The benchmark is (again) `gcbench.scm'; the baseline is current Guile `master': * no static allocation (boehm-demers-weiser-gc) heap size (MiB) execution time (s.) Guile 53.83 (1.00x) 21.167 (1.00x) BDW-GC, FSD=3D3 53.22 (0.99x) 15.204 (0.72x) ! BDW-GC, FSD=3D6 53.11 (0.99x) 15.457 (0.73x) ! BDW-GC, FSD=3D9 43.62 (0.81x) 16.810 (0.79x) ! BDW-GC, FSD=3D3 incr. 63.22 (1.17x) 19.716 (0.93x) BDW-GC, FSD=3D3 gene. 96.42 (1.79x) 18.641 (0.88x) * static allocation, `-z relro' (bdw-gc-static-alloc) heap size (MiB) execution time (s.) Guile 53.83 (1.00x) 20.556 (1.00x) BDW-GC, FSD=3D3 47.33 (0.88x) 14.391 (0.70x) ! BDW-GC, FSD=3D6 46.75 (0.87x) 14.914 (0.73x) ! BDW-GC, FSD=3D9 44.74 (0.83x) 15.130 (0.74x) ! BDW-GC, FSD=3D3 incr. 82.51 (1.53x) 19.023 (0.93x) BDW-GC, FSD=3D3 gene. 93.87 (1.74x) 17.147 (0.83x) * static allocation (bdw-gc-static-alloc), *without* `-z relro' heap size (MiB) execution time (s.) Guile 53.83 (1.00x) 21.768 (1.00x) BDW-GC, FSD=3D3 55.85 (1.04x) 16.156 (0.74x) BDW-GC, FSD=3D6 55.29 (1.03x) 15.220 (0.70x) BDW-GC, FSD=3D9 44.74 (0.83x) 16.355 (0.75x) ! BDW-GC, FSD=3D3 incr. 102.09 (1.90x) 20.571 (0.95x) BDW-GC, FSD=3D3 gene. 89.70 (1.67x) 19.215 (0.88x) (Heap usage in incremental mode seems to be highly variable in this case, sometimes going as high as 128 MiB.) Conclusions =2D---------- Libgc's handling of `PT_GNU_RELRO' segments provides a noticeable improvement. With it, static allocation actually improves performance (5%) and leads to reduced heap usage (11%). However, when not linking with `-z relro', static allocation leads to slightly degraded performance and increased heap usage (perhaps due to misidentified pointers in the `.data.rel.ro' section?). This is probably worth some investigation on the BDW-GC side. Thanks, Ludo'. [0] http://git.savannah.gnu.org/gitweb/?p=3Dguile.git;a=3Dcommit;h=3D5f2362= 08d0d864546e59afa0f5a11c9b3ba14b10 [1] http://thread.gmane.org/gmane.comp.programming.garbage-collection.boehm= gc/2570 [2] http://thread.gmane.org/gmane.comp.programming.garbage-collection.boehm= gc/2716 --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkqduykACgkQd92V4upS7PTtdQCfT1O4Nz2JhQ5y5U+Oz6KqbsYc SVEAoJrbuGFPrYQj6c83JK9RcpbW64U8 =Gfbs -----END PGP SIGNATURE----- --=-=-=--