unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: "Aleix Conchillo Flaqué" <aconchillo@gmail.com>
Cc: guile-user <guile-user@gnu.org>, guile-devel <guile-devel@gnu.org>
Subject: Re: Guile's time execution issues
Date: Sat, 02 May 2020 16:11:00 +0200	[thread overview]
Message-ID: <87a72q77gr.fsf@gnu.org> (raw)
In-Reply-To: <CA+XASoUwckB7vFU4DoTaEURaZOuawySfbwrC4wJoxnf3BXyXcg@mail.gmail.com> ("Aleix Conchillo \=\?utf-8\?Q\?Flaqu\=C3\=A9\=22's\?\= message of "Sun, 26 Apr 2020 16:14:32 -0700")

Hola!

Aleix Conchillo Flaqué <aconchillo@gmail.com> 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 = #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 = #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 = #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=/tmp -- guile 
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 = #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 = #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 = #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 ‘json->scm’ to see if there’s anything
that could be improved on the Guile side, or if it’s just a normal
profile for GC-intensive code.

Thanks,
Ludo’.



  reply	other threads:[~2020-05-02 14:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-21 22:03 Guile's time execution issues Aleix Conchillo Flaqué
2020-04-22 13:47 ` Linus Björnstam
2020-04-26 17:16 ` Ludovic Courtès
2020-04-26 23:14   ` Aleix Conchillo Flaqué
2020-05-02 14:11     ` Ludovic Courtès [this message]
2020-05-04  0:32       ` Aleix Conchillo Flaqué
2020-05-04  9:36         ` Ludovic Courtès
2020-05-04 11:19           ` Linus Björnstam
2020-05-04 20:09             ` Ludovic Courtès
2020-05-04 20:50               ` Linus Björnstam
2020-05-08 11:31                 ` Linus Björnstam
2020-05-04 18:47           ` Linus Björnstam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a72q77gr.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=aconchillo@gmail.com \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).