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?Aleix_Conchillo_Flaqu=C3=A9?= Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Guile's time execution issues Date: Tue, 21 Apr 2020 15:03:21 -0700 Message-ID: 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="100114"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user , guile-devel Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Apr 22 00:04:05 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 1jR0zt-000PwZ-IV for guile-user@m.gmane-mx.org; Wed, 22 Apr 2020 00:04:05 +0200 Original-Received: from localhost ([::1]:36734 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jR0zs-0001zw-9G for guile-user@m.gmane-mx.org; Tue, 21 Apr 2020 18:04:04 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48810) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jR0zU-0001zq-6v for guile-user@gnu.org; Tue, 21 Apr 2020 18:03:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jR0zT-00013j-0l for guile-user@gnu.org; Tue, 21 Apr 2020 18:03:39 -0400 Original-Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:35499) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jR0zS-0000rH-8k; Tue, 21 Apr 2020 18:03:38 -0400 Original-Received: by mail-lj1-x231.google.com with SMTP id g4so166793ljl.2; Tue, 21 Apr 2020 15:03:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=PPYXPOBi/frEDagfxEBqRoc2XLaHQpx24Sb4H+/oU3A=; b=JMIJMNoW9l9iPrrtb2NTllRML9VpABx9B6vsdsAX5VwF8cwMzKfRKJrixHgP2KEWlf HsmeG5H4MnwUIhaeTVnDqbE/2c8oLtQ9vf3NdLEZB8PufWPMcDth5IaTkPB7wMcY47JN FnyLiHIWV0Eu5DGdZU6K+tUgCq3bQgpzDBuWFSGt7u7EFltWL25O+wL7Aqu6s+b23OFe u3yuTToXMFVUS/OZpsk7IcdJ/RGUclXqHaMY+PkJ8puUEc3kKfNZ1No1Wn8SJS4J90qq 2PbnOQuAZEVLYT4gnZ7ZnQoygXyUcl1dfG+96b04PGGnxW+NwKDylgoZgp2tdR/H224I /9bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=PPYXPOBi/frEDagfxEBqRoc2XLaHQpx24Sb4H+/oU3A=; b=jDPksFth04oKPJvR1ZJcqKi2PuGYo+Uuvz0/V1rzPRbo+iR9mb5AuQ4qcp/EzFR8aF Ahhigg64Gl8soe3Gj7Ps1xbAyigsUSSQ8o9v5uWpGzqqFhLFvwDUryI0zQVyU9bD3mKZ XqnMxt4nR3x9JUdZxTzUY3WqXRR386tkZdqUYsnphE6SN9C9ABYXTJAaP2pBwjP+KYg8 JL1MjkzZMZ0oGfmPudPXQlRKyfwLfXz2ctQOZ29ak7gbwq/dFWcTQqAPvIH9j+hzexxo fbwiBKAUAwHdHPuyDRHe51skaqg6/Ovel15Y0rrq6xcOq4Yv53INDu0UQHlYuhfi1nAv pUUw== X-Gm-Message-State: AGi0PubArJ41i+kYoSAmnhQGnkABmDgAVKBQpbRWwauh21zB8nlnofxW 7suo6NWYcnJIlXE9HUCUcrBo1TprMa4ZNPCzATYZRXEWXEY= X-Google-Smtp-Source: APiQypIzqdwVxiu9wnftFzPYz1io+SBkdv2w2BYoc5yHkskP5VtouyCqzCYhy9x7ThRR7zvNrhtl4hjhAp8Q/5dzZ2A= X-Received: by 2002:a2e:888f:: with SMTP id k15mr11982761lji.198.1587506612798; Tue, 21 Apr 2020 15:03:32 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=aconchillo@gmail.com; helo=mail-lj1-x231.google.com X-detected-operating-system: by eggs.gnu.org: Error: [-] PROGRAM ABORT : Malformed IPv6 address (bad octet value). Location : parse_addr6(), p0f-client.c:67 X-Received-From: 2a00:1450:4864:20::231 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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:16397 gmane.lisp.guile.devel:20490 Archived-At: Hi, I was trying to get some guile-json performance times loading large JSON file. However, I'm getting increasing numbers at each run, so I'm wondering if I'm doing something wrong. Below you can see how the first run took 19.95s and then running the same command kept increasing. I'm running Guile 2.2.7 on macOS Catalina 10.15.3. scheme@(guile-user)> (use-modules (json)) scheme@(guile-user)> ,t (define a (call-with-input-file "/Users/aleix/Downloads/large-file.json" (lambda (port) (json->scm port)))) ;; 19.956429s real time, 87.100982s run time. 75.270202s spent in GC. ;; 26.173179s real time, 143.645265s run time. 131.022631s spent in GC. ;; 28.193926s real time, 154.758375s run time. 141.697236s spent in GC. ;; 29.044218s real time, 160.745984s run time. 147.449073s spent in GC. ;; 30.480873s real time, 170.855527s run time. 157.332793s spent in GC. ;; 30.555700s real time, 172.938278s run time. 159.468737s spent in GC. ;; 32.190478s real time, 172.807551s run time. 158.905645s spent in GC. The good news is that I have applied a suggestion from Linus Bj=C3=B6rnstam= that reduces times by half (considering the first run above). The suggestion was to use string ports instead of string-append. And interestingly this time, time executions remain around the same value: scheme@(guile-user)> ,t (define a (call-with-input-file "/Users/aleix/Downloads/large-file.json" (lambda (port) (json->scm port)))) ;; 9.099597s real time, 17.239176s run time. 9.309819s spent in GC. ;; 9.927868s real time, 20.855859s run time. 12.528727s spent in GC. ;; 8.981248s real time, 15.043991s run time. 7.050269s spent in GC. ;; 9.055893s real time, 15.400981s run time. 7.383187s spent in GC. ;; 9.055850s real time, 15.261824s run time. 7.239188s spent in GC. ;; 9.315239s real time, 15.231889s run time. 7.005570s spent in GC. ;; 9.106168s real time, 14.987678s run time. 6.915028s spent in GC. ;; 9.175142s real time, 14.471324s run time. 6.302749s spent in GC. ;; 8.966537s real time, 14.400318s run time. 6.412858s spent in GC. JSON test data obtained from: https://github.com/json-iterator/test-data/blob/master/large-file.json Best, Aleix