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?Ludovic_Court=C3=A8s?= Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: Guile's time execution issues Date: Sat, 02 May 2020 16:11:00 +0200 Message-ID: <87a72q77gr.fsf@gnu.org> References: <87d07u182a.fsf@gnu.org> Mime-Version: 1.0 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="84431"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: guile-user , guile-devel To: Aleix Conchillo =?utf-8?Q?Flaqu=C3=A9?= Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sat May 02 16:11:21 2020 Return-path: Envelope-to: guile-user@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 1jUsrR-000Lsi-71 for guile-user@m.gmane-mx.org; Sat, 02 May 2020 16:11:21 +0200 Original-Received: from localhost ([::1]:46444 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUsrQ-0002xi-7p for guile-user@m.gmane-mx.org; Sat, 02 May 2020 10:11:20 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59072) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jUsrD-0002ta-7a; Sat, 02 May 2020 10:11:07 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:58176) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jUsrC-0006AU-SP; Sat, 02 May 2020 10:11:06 -0400 Original-Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=47750 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1jUsrB-0004ya-HA; Sat, 02 May 2020 10:11:06 -0400 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 14 =?utf-8?Q?Flor=C3=A9al?= an 228 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 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-pc-linux-gnu In-Reply-To: ("Aleix Conchillo \=\?utf-8\?Q\?Flaqu\=C3\=A9\=22's\?\= message of "Sun, 26 Apr 2020 16:14:32 -0700") X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:16416 gmane.lisp.guile.devel:20505 Archived-At: Hola! Aleix Conchillo Flaqu=C3=A9 skribis: > On guile-json 3.5.0 (still using (string-append)) the first execution time > goes from 19 seconds to 42 seconds. Then, the times keep increasing as in > version 2.2.7 but numbers are much bigger: With Guile 3.0.2 and Guile-JSON 3.5.0, I get: --8<---------------cut here---------------start------------->8--- $ guile GNU Guile 3.0.2 Copyright (C) 1995-2020 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> ,use(json) scheme@(guile-user)> ,t (->bool (call-with-input-file "/tmp/large-file.json= " json->scm)) $1 =3D #t ;; 55.142128s real time, 79.806656s run time. 65.418070s spent in GC. scheme@(guile-user)> ,t (->bool (call-with-input-file "/tmp/large-file.json= " json->scm)) $2 =3D #t ;; 47.416645s real time, 75.274219s run time. 62.421108s spent in GC. scheme@(guile-user)> ,t (->bool (call-with-input-file "/tmp/large-file.json= " json->scm)) $3 =3D #t ;; 41.292368s real time, 79.053120s run time. 67.266710s spent in GC. --8<---------------cut here---------------end--------------->8--- So I think the time increase was just due to the fact that previous parse results were kept around, somehow. 2.2.7 performs comparably for me: --8<---------------cut here---------------start------------->8--- $ guix environment -C --ad-hoc guile-json guile@2.2 --share=3D/tmp -- guile= =20 guix environment: warning: plursenca pak-specifigo 'guile@2.2' guix environment: warning: choosing guile@2.2.7 from gnu/packages/guile.scm= :256:2 GNU Guile 2.2.7 Copyright (C) 1995-2019 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> ,use(json) scheme@(guile-user)> ,t (->bool (call-with-input-file "/tmp/large-file.json= " json->scm)) $1 =3D #t ;; 44.963180s real time, 90.606198s run time. 71.529811s spent in GC. scheme@(guile-user)> ,t (->bool (call-with-input-file "/tmp/large-file.json= " json->scm)) $2 =3D #t ;; 44.147740s real time, 87.796937s run time. 69.818018s spent in GC. scheme@(guile-user)> ,t (->bool (call-with-input-file "/tmp/large-file.json= " json->scm)) $3 =3D #t ;; 45.057761s real time, 89.689930s run time. 71.370764s spent in GC. --8<---------------cut here---------------end--------------->8--- So to me, Guile is behaving correctly here. Now, it would be good to profile =E2=80=98json->scm=E2=80=99 to see if ther= e=E2=80=99s anything that could be improved on the Guile side, or if it=E2=80=99s just a normal profile for GC-intensive code. Thanks, Ludo=E2=80=99.