Am 30.01.2018 um 16:28 schrieb Kieren MacMillan:
Hello all,

For those who make heavy use of stylesheets and/or overrides and tweaks:
Do you have one large file? Several smaller files? One file per override?

Currently, I use "several smaller files", e.g.,

     /tweaks/dynamics.ily
     /tweaks/lyrics.ily
     /tweaks/spacing.ily

This looks like a reasonable grouping.


and so on.

But each of those files is pretty big (i.e., often containing many functions, 
many of which comprise a large number of lines). And I'm wondering if there's 
much of a performance hit when I load them multiple times (e.g., in a songbook, 
where the included file is brought in with each song that is included). That's 
especially inefficient if I'm only using one small function from the entire 
tweak file.

Thoughts and advice appreciated.

If this is a regular case I would look for a way to include them only once. Including them multiple times definitely doesn't make sense as the file will be completely parsed again and all the definitions just overwritten.

The approach I would use (doesn't necessarily mean it's the best one) is:

 * replace the \include with a new function
 * have that function add the included filels absolute path to some list
 * check that list before including the file

This is totally improvised, but with oll-core loaded you could do something along the lines of

% provide a storage space
\registerOption kieren.included-files #'()

% in a loading function ('to-include' is the file to check:
#(if (not (getOptionWithFallback `(kieren included-files ,to-include) #f))
     (do-include-file to-include))


just as a rough idea.

Best
Urs

Thanks,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to