From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: =?utf-8?Q?Hans_=C3=85berg?= Newsgroups: gmane.lisp.guile.devel Subject: Re: CPU and GC cost of bignums Date: Wed, 5 Feb 2020 22:28:40 +0100 Message-ID: References: <87imkmwass.fsf@gnu.org> <87zhdxknf9.fsf@gnu.org> Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="111929"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Andy Wingo , Guile Devel To: =?utf-8?Q?Ludovic_Court=C3=A8s?= Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Feb 05 22:29:02 2020 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1izSEH-000SxC-OW for guile-devel@m.gmane-mx.org; Wed, 05 Feb 2020 22:29:01 +0100 Original-Received: from localhost ([::1]:56948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izSEG-0001qw-Qq for guile-devel@m.gmane-mx.org; Wed, 05 Feb 2020 16:29:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43474) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1izSE3-0001qo-F5 for guile-devel@gnu.org; Wed, 05 Feb 2020 16:28:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1izSE1-0007G1-QK for guile-devel@gnu.org; Wed, 05 Feb 2020 16:28:46 -0500 Original-Received: from v-smtpout1.han.skanova.net ([81.236.60.154]:50778) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1izSE1-0007A6-Ii for guile-devel@gnu.org; Wed, 05 Feb 2020 16:28:45 -0500 Original-Received: from [10.0.1.8] ([90.227.203.185]) by cmsmtp with ESMTPA id zSDxiFQ9KeFh7zSDxi5dzo; Wed, 05 Feb 2020 22:28:43 +0100 In-Reply-To: <87zhdxknf9.fsf@gnu.org> X-Mailer: Apple Mail (2.3608.60.0.2.5) X-CMAE-Envelope: MS4wfNr24nw/6TTLo3Gr6myycYPbAYVYWMYHu1qE+oQnIyhnxgLWmyr59qw7QBVJhdikItJWgFKIF/vcnFgHBLdoK4IGoFPyODPcZH2WXBkzNfntuf/BvjA+ nfBGOIA/aUShaIuBHBcEPzUNj/KwMk0jFNlocfGg9GkyluNfxir3aURtYcLpxWD6JVBxgdcQb3Ow9DIPIUgyoI0RVgyFFPO2IlE= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 81.236.60.154 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20391 Archived-At: > On 5 Feb 2020, at 17:29, Ludovic Court=C3=A8s wrote: >=20 > Hey ho! >=20 > Ludovic Court=C3=A8s skribis: >=20 >> =E2=80=A6 but has the disadvantage that it doesn=E2=80=99t work: = =E2=80=98numbers.test=E2=80=99 fails >> badly on bignums. >=20 > I think with the excitement I no longer knew what I was saying. So, > here=E2=80=99s a revised patch that actually preserves memory = management (as in: > =E2=80=98mpz_t=E2=80=99 are eventually freed), while getting rid of = finalizers. When I tested the Boehm GC in a C++ program, the finalizers did not seem = to make much difference. However, if the program is threaded, it puts = locks around all GC allocations, which I think may be time consuming. So = maybe you should try letting GMP use ordinary malloc, and GC allocations = only for the SCM values creating them, deleting when finalized.