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

Improve startup time #956

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

walles
Copy link
Contributor

@walles walles commented Apr 8, 2024

By not loading styles until they are needed.

This takes moar's startup time down from ~25ms to ~18ms on my machine.

One potential downside of this change is that NewEmbeddedXMLStyle() is added to the public API.

But since styles are split between style.go and styles/api.go I was unable to come up with a solution that didn't change the public API.

Also I'm unsure whether the improved startup performance is worth the extra complexity (which isn't bad really, but still). You be the judge of that.

This takes moar's startup time down from ~25ms to ~18ms on my machine.
@walles walles changed the title johan/lazy styles Don't load styles until they are needed Apr 8, 2024
@walles walles marked this pull request as ready for review April 8, 2024 05:09
@walles walles changed the title Don't load styles until they are needed Improve startup time Apr 17, 2024
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.

None yet

1 participant