From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Amirouche Newsgroups: gmane.lisp.guile.bugs Subject: bug#39130: Speed up C Foreign Function Interface Date: Tue, 14 Jan 2020 12:15:06 +0000 Message-ID: <8bbf48a40a280fb121bb5036ffd46b70@hyper.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="263412"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Roundcube Webmail/1.3.8 To: 39130@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Tue Jan 14 13:16:17 2020 Return-path: Envelope-to: guile-bugs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1irL7I-00162a-Tb for guile-bugs@m.gmane-mx.org; Tue, 14 Jan 2020 13:16:17 +0100 Original-Received: from localhost ([::1]:38324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irL7H-0006C9-9p for guile-bugs@m.gmane-mx.org; Tue, 14 Jan 2020 07:16:15 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34481) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1irL79-0006Bj-1E for bug-guile@gnu.org; Tue, 14 Jan 2020 07:16:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1irL74-0007MX-Tz for bug-guile@gnu.org; Tue, 14 Jan 2020 07:16:06 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54783) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1irL74-0007LC-77 for bug-guile@gnu.org; Tue, 14 Jan 2020 07:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1irL74-00064H-3u for bug-guile@gnu.org; Tue, 14 Jan 2020 07:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Amirouche Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Tue, 14 Jan 2020 12:16:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 39130 X-GNU-PR-Package: guile X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.157900413223283 (code B ref -1); Tue, 14 Jan 2020 12:16:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Jan 2020 12:15:32 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-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) X-Sender: amirouche@hyper.dev X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane-mx.org@gnu.org Original-Sender: "bug-guile" Xref: news.gmane.org gmane.lisp.guile.bugs:9513 Archived-At: 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?