lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Moving most initialization to .scm files


From: Jean Abou Samra
Subject: Moving most initialization to .scm files
Date: Sun, 4 Sep 2022 22:38:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0

Hi,

The long saga of https://gitlab.com/lilypond/lilypond/-/merge_requests/1510
continues ...

The problem I am currently tackling is startup speed. When byte-compiling the
code in .ly files, startup time increases from 0.3s to 0.8s, which is not
quite acceptable. This is because the Guile byte-compiler is dog slow
(even without optimizations), and it has to run on all the Scheme code
there is in the init .ly files. (And this is in Guile 3. I didn't measure
Guile 2 but I expect it to be even slower there.)

We could invent a mechanism to cache the bytecode from .ly files, like Guile
does in .go files for .scm files. This sounds complicated to me.

Or we can reuse the existing mechanism: move all this code to Scheme files.
So I'm considering converting all files like music-functions-init.ly to
Scheme files, changing (e.g.)

function =
#(define-music-function (args) (type?)
   ...)

to

(define-public function
  (define-music-function (args) (type?)
    ...))

This needs to be done for lots of code in lots of files, so it will be
quite a major change to the source even though it is just a straightforward
translation. In particular, it will create conflicts with everyone's WIP
local branches, so I thought I'd ask for thoughts here before embarking on
it. If anyone has a better idea ...





reply via email to

[Prev in Thread] Current Thread [Next in Thread]