Description
The current variantlib.api
design assumes that individual functions take a bunch of parameters (metadata, use_auto_install
and so on) and create plugin loaders internally. Nowadays this may also involve actually creating the isolated environment and installing the same plugins there multiple times, which can have a serious performance impact — so we should reconsider caching.
My original design assumed that you'd just create a PluginLoader
directly and pass it around, so it would carry all the cached state. To be honest, I really like that design because everything about it was quite explicit.
If we don't want explicit, we can look into implicit caching — but we need to make sure that the cache key includes all these parameters and the relevant bits of variant metadata (the whole provider table).