Options for trimming precompile caches of third-party dependencies

I haven’t ran into a situation where it’d be significantly useful to load less from third-party packages, but is it at all possible to trim their precompile caches to only what my package needs without going as far as forking the dependencies? Or perhaps accomplish the same outcome by discarding their precompile caches and precompiling only what’s needed by my package? Correct me if I’m wrong, but I think v1.8+ introducing caching code compiled from methods defined outside the package would make that second possibility feasible. The wording in the 1.8 highlights actually isn’t too clear to me whether it requires all cached code to be ultimately called by methods defined in my package, or if something like notmymethod(MyType()) or even notmymethod(NotMyTypeEither()) in the global scope would be cached.

I have doubts this is sensible as is because while it might be useful to limit the loaded code from dependencies when my package is the primary focus, I wouldn’t want to reduce the precompile caches of packages I explicitly added to an environment just because I also happened to add my package that happens to have them as dependencies.

1 Like