chroma
chroma copied to clipboard
Improve startup time
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.