Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.1k
Description
Summary
All colormaps are currently created at import-time. Additionally, Colormap classes have a deferred initialization of their lookup table (I suspect to save memory/initialization cost).
This design is sub-optimal as we still pay some up-front cost for creating all the colormaps whereas a typical use case would only use a few at most.
Proposed fix
ChangeColormapRegistry
so that it only creates requested colormaps on demand (and caches them once they are there). - Probably we still need some sort of ColormapSpec as internal placeholders in ColormapRegistry so that it knows which colormaps are available without haveing to create all.
We can then remove the deferred initialization on Colormap, which makes that class much simpler.