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

Remove startup overhead? #30

Open
mperham opened this issue Nov 28, 2023 · 1 comment
Open

Remove startup overhead? #30

mperham opened this issue Nov 28, 2023 · 1 comment

Comments

@mperham
Copy link

mperham commented Nov 28, 2023

The colors gem is slow to require because it generates a lot of constants and structures at boot time. For instance:

named [0xf0, 0xf8, 0xff], :AliceBlue

Would it be possible to lazy load these named constants and hashes only upon first access?

@halostatue
Copy link
Owner

Yes, but…

I’m caught in a bit of a spiral with this library. There are a number of fixes that should be applied to it (missing features with at least two different competing and incompatible implementations, a bit of modernization, possible performance optimizations beyond lazy boot, etc.) and every time I get started…I can't get motivated to complete any of it. It needs a new version that sheds a lot of the old version baggage (there is no reason to continue supporting anything less than Ruby 2.7 with new releases) and approaches the problem differently (at this point, if I were to approach this, I would look at it with oklab as the core representation and everything else would be put through colourspace transformations).

I really should put this up for adoption, but there's a part of me that isn't quite ready to give it up unless and until I can get it onto a good path moving forward.

All of that to say…I would take a PR that does this, but I can't really speak to the overall releasability of the code without taking time that I don’t currently have.

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

No branches or pull requests

2 participants