unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Dr. Arne Babenhauserheide" <arne_bab@web.de>
To: guile-devel@gnu.org
Subject: FWD: Test reader speed of Guile 3.0.6 in Lilypond
Date: Thu, 18 Mar 2021 09:30:43 +0100	[thread overview]
Message-ID: <87czvwj230.fsf@web.de> (raw)
In-Reply-To: CAOw_e7ZxEWWU6mxJx2cNgb4nyjXnw8ZtYCa+Lp_k=-2WkSpGCg@mail.gmail.com

[-- Attachment #1: Type: text/plain, Size: 3061 bytes --]

Hi,

due to the reader-rewrite, I asked in the lilypond-list for testing,
because they are likely the strongest power-user of the reader.

Han-Wen Nienhuys checked performance in the benchmark suite:

> $ cat ../bench.ly
> #(define (microseconds)
>   (let* ((t (gettimeofday))
> (us (/ (cdr t) 1000000.0)))
>    (+ (car t) us)))
>
> #(define start (microseconds))
>
> % \include "bench-largeexp.ly"
> \include "bench-manysmall.ly"
>
> #(newline)
> #(display (- (microseconds) start))
>
> Parsing & evaluating '(1 2 3) 200 times.
> - guile 1.8: 1.25ms
> - guile 2.2: 3.2ms
> - guile 3.0.6: 2.08ms
>
> Parsing & evaluating the giant expression in define-grobs.scm once:
>
> - guile 1.8: 10.6ms
> - guile 2.2: 166ms
> - guile 3.0.6: 71ms
>
> Parsing & evaluating the giant expression in define-grobs.scm once
> (but quoted, ie. not real evaluation):
>
> - guile 1.8: 10.0ms
> - guile 2.2: 13ms
> - guile 3.0.6: 12.8ms
>
> In summary, the read speed itself for large expressions is on the same
> order as 1.8, but for many small expressions (which is a much more
> common use-case) there is still a 60% slowdown.

>> asking here because I want to avoid surprising and avoidable changes
>> that block Lilypond. I consider Lilypond to be the most important
>> flagship project of Guile, and I want to do what I can to prevent
>> unnecessary friction.

> I appreciate the heads up you gave here today, but from our side, it
> doesn't seem like the Guile project is much concerned with our needs.
> The evaluation speed of GUILE 3.x is still pretty poor. Having fast,
> JIT'ed code seems interesting in theory, but the way it's implemented
> in Guile 3.x is a giant headache: the separate byte compilation is
> extremely slow, and it is hard to manage (where should the .go files
> be stored/installed, how/when are they generated etc.). It also
> doesn't match our use case, because a lot of the code that we have
> comes from .ly files, so it cannot be precompiled.

Are there ways to improve this? For example sticking to the baseline
compiler (as described in the wingolog:
https://wingolog.org/archives/2020/06/03/a-baseline-compiler-for-guile )

>> The article linked above shows that setting -O1 as optimization of the
>> code could help (if you’re not already doing that).

> The article gives a pointer to the code, which is
> module/language/tree-il/compile-bytecode.scm. I ran
> 
> for c in  $(git log module/language/tree-il/compile-bytecode.scm|grep
> commit|awk '{print $2;}'); do git show $c ; done | grep -i doc
> 
> to look for documentation, but couldn't find it. The module has one
> exported symbol, which is compile-bytecode.
> 
> Could you give some practical tips on how we'd use this?

Can someone help with this?

It would be pretty cool if there were a simple way to speed-up lilypond
like changing optimization level that just got lost in communication (or
missing docs).

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein
ohne es zu merken

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 1125 bytes --]

       reply	other threads:[~2021-03-18  8:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <878s6vaa7c.fsf@web.de>
     [not found] ` <CAOw_e7b8-AAROs4SrB+E=fG=ORDdjgG_AbcWW2ytS1tHHmAGdA@mail.gmail.com>
     [not found]   ` <87v99wf1n0.fsf@web.de>
     [not found]     ` <CAOw_e7ZxEWWU6mxJx2cNgb4nyjXnw8ZtYCa+Lp_k=-2WkSpGCg@mail.gmail.com>
2021-03-18  8:30       ` Dr. Arne Babenhauserheide [this message]
2021-03-18 17:21         ` FWD: Test reader speed of Guile 3.0.6 in Lilypond Dr. Arne Babenhauserheide
2021-04-11 21:32         ` Dr. Arne Babenhauserheide
     [not found] ` <f352b8c6-6a8b-4a6d-85ac-ec32cd33fc3a@t-online.de>
     [not found]   ` <e968a361-397e-8634-4521-ad1a4801b9de@gmail.com>
     [not found]     ` <cab2cdfa-6c45-c07e-8c5e-be3dde767281@t-online.de>
     [not found]       ` <CAGebFpKhKtQ2u6N2Le-fc1A4sp=9siHAbPkV4RCS6GOZ84YF+w@mail.gmail.com>
     [not found]         ` <11662b16-c4e3-6d48-7496-6914b35e9c8e@t-online.de>
2021-03-21  8:21           ` Fwd: Re: Test reader speed of Guile 3.0.6 Dr. Arne Babenhauserheide

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=87czvwj230.fsf@web.de \
    --to=arne_bab@web.de \
    --cc=guile-devel@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).