From unknown Sat Jun 14 03:51:02 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#39130 <39130@debbugs.gnu.org> To: bug#39130 <39130@debbugs.gnu.org> Subject: Status: Speed up C Foreign Function Interface Reply-To: bug#39130 <39130@debbugs.gnu.org> Date: Sat, 14 Jun 2025 10:51:02 +0000 retitle 39130 Speed up C Foreign Function Interface reassign 39130 guile submitter 39130 Amirouche severity 39130 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 14 07:15:32 2020 Received: (at submit) by debbugs.gnu.org; 14 Jan 2020 12:15:32 +0000 Received: from localhost ([127.0.0.1]:60756 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irL6V-00063P-Ul for submit@debbugs.gnu.org; Tue, 14 Jan 2020 07:15:32 -0500 Received: from lists.gnu.org ([209.51.188.17]:51860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1irL6O-00063B-Pa for submit@debbugs.gnu.org; Tue, 14 Jan 2020 07:15:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34377) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irL6J-0005wE-OE for bug-guile@gnu.org; Tue, 14 Jan 2020 07:15:20 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irL6E-00078r-FA for bug-guile@gnu.org; Tue, 14 Jan 2020 07:15:15 -0500 Received: from relay11.mail.gandi.net ([217.70.178.231]:38401) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1irL6E-00078L-8y for bug-guile@gnu.org; Tue, 14 Jan 2020 07:15:10 -0500 Received: from webmail.gandi.net (webmail14.sd4.0x35.net [10.200.201.14]) (Authenticated sender: amirouche@hyper.dev) by relay11.mail.gandi.net (Postfix) with ESMTPA id 549B9100006 for ; Tue, 14 Jan 2020 12:15:06 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 14 Jan 2020 12:15:06 +0000 From: Amirouche To: bug-guile@gnu.org Subject: Speed up C Foreign Function Interface Message-ID: <8bbf48a40a280fb121bb5036ffd46b70@hyper.dev> X-Sender: amirouche@hyper.dev User-Agent: Roundcube Webmail/1.3.8 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.70.178.231 X-Spam-Score: -1.6 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) I benchmarked Chez Scheme vs. Guile. Guile is 3 to 5 times slower than Chez. I attribute that mostly to C Foreign Function Interface. The application will parse a text file (n-turtle format) and store in an embedded database (wiredtiger). Most the CPU time should be spent during parsing [0], then packing scheme objects into bytevectors [1] and at last C FFI. [0] https://github.com/amirouche/nomunofu/blob/master/nomunofu/index.scm#L13 [1] https://github.com/amirouche/nomunofu/blob/master/nomunofu/okvs/pack.scm#L208 The chez code is in wip-chez branch. The Guile FFI code of that particular application can be improved. Still, I read on IRC that there is some interests to improve C FFI, that is why I fill this issue to be able to keep track of it. One step forward, would be to have C FFI benchmarks that are easy to run with Chez, Guile, and Gambit. Anyone up for the task? From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 18 08:23:44 2020 Received: (at 39130) by debbugs.gnu.org; 18 Feb 2020 13:23:44 +0000 Received: from localhost ([127.0.0.1]:39651 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j42qm-0007dW-1O for submit@debbugs.gnu.org; Tue, 18 Feb 2020 08:23:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59347) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j42qk-0007dL-5g for 39130@debbugs.gnu.org; Tue, 18 Feb 2020 08:23:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:46187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1j42qe-0001eA-OC; Tue, 18 Feb 2020 08:23:36 -0500 Received: from [143.121.198.62] (port=46400 helo=cog147) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1j42qe-0002g2-34; Tue, 18 Feb 2020 08:23:36 -0500 Message-ID: <28e8671f61bf2160e7f0d55b72be967170b4d1fe.camel@gnu.org> Subject: Re: bug#39130: Speed up C Foreign Function Interface From: Roel Janssen To: Amirouche , 39130@debbugs.gnu.org Date: Tue, 18 Feb 2020 14:23:34 +0100 In-Reply-To: <8bbf48a40a280fb121bb5036ffd46b70@hyper.dev> References: <8bbf48a40a280fb121bb5036ffd46b70@hyper.dev> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 39130 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Dear Amirouche, The Github links don't seem to work (for me). Kind regards, Roel Janssen On Tue, 2020-01-14 at 12:15 +0000, Amirouche wrote: > I benchmarked Chez Scheme vs. Guile. Guile is 3 to 5 times slower > than Chez. I attribute that mostly to C Foreign Function Interface. > > The application will parse a text file (n-turtle format) and store > in an embedded database (wiredtiger). Most the CPU time should be > spent during parsing [0], then packing scheme objects into > bytevectors [1] and at last C FFI. > > [0] > https://github.com/amirouche/nomunofu/blob/master/nomunofu/index.scm#L13 > > [1] > https://github.com/amirouche/nomunofu/blob/master/nomunofu/okvs/pack.scm#L208 > > The chez code is in wip-chez branch. > > The Guile FFI code of that particular application can be improved. > > Still, I read on IRC that there is some interests to improve C FFI, > that is why I fill this issue to be able to keep track of it. > > One step forward, would be to have C FFI benchmarks that are easy > to run with Chez, Guile, and Gambit. > > Anyone up for the task? > > > >