Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call load_customisations! automatically, lazily #94

Merged
merged 1 commit into from
Sep 20, 2024
Merged

Conversation

tecosaur
Copy link
Collaborator

This is a follow-up to #79, see the commit message for more details.

I've been wary about doing lazy application of load_customisations!, but
with the @noinline addition the calls are really cheap: only 1.5ns
according to Chairmarks on my machine. Thus, the cost of calling it
after initialisation will be negligeable for any non-trivial function.

Having rolled this around further, other than printing I think only
withfaces calls actually require loading of user styles to be valid.

With these two realisations, calling load_customisations! lazily as
appropriate seems like a bit of a no-brainer.

We'll probably want to add this to public API eventually for
non-text/html output implementations, but we can wait to see how this is
bourne out first.
@tecosaur tecosaur merged commit da41b6a into main Sep 20, 2024
5 checks passed
@tecosaur tecosaur deleted the lazy-init branch September 20, 2024 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant