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

Closed
wants to merge 2 commits into from
Closed

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
@alecthomas
Copy link
Owner

Thanks, but I don't think the extra complexity is worth such a minor gain in performance.

@alecthomas alecthomas closed this Jun 4, 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.

2 participants