timholy / SnoopCompile.jl

Provide insights about latency (TTFX) for Julia packages
https://timholy.github.io/SnoopCompile.jl/dev/
Other
309 stars 48 forks source link

Add option to globally disable snoop precompilation #299

Closed baggepinnen closed 1 year ago

baggepinnen commented 2 years ago

This implements one of the suggestions from #298 and allows the user to opt out of all precompilation by setting the environment variable ENV["SNOOP_PRECOMPILE"] = false

timholy commented 2 years ago

The issue I see with this is that it may leave people in a complicated mix of *.ji files: those that happened to be written while SNOOP_PRECOMPILE=0 and those written when it defaulted to being on. That means TTFX could vary wildly depending on the specifics of your precompilation history. Morever, this doesn't seem to have a mechanism for ensuring that the precompiled versions get generated & used when you stop setting SNOOP_PRECOMPILE=0. The only option for a "clean house" would be to delete all the files in your .julia/compiled/v1.x directory and then precompile everything.

However, I think if we use Preferences.jl, all these negatives go away. Care to try an implementation using Preferences and see if it solves your problem?

timholy commented 1 year ago

Just checking in, is this something you're planning to do or should I marked this "help wanted"?

baggepinnen commented 1 year ago

I'd be happy to do this, I've been out-of-office for a while but will try to get to it after the backlog has been worked through.

timholy commented 1 year ago

With native-code compilation about to be merged, this will become quite urgent. I'll tackle it myself within a week unless you tell me otherwise.

timholy commented 1 year ago

I think we also want the ability to turn it off for specific packages, again under Preferences.jl control. Typically I think you'd want to turn it off for just the package you're actively working on.

t-bltg commented 1 year ago

Superseded by https://github.com/timholy/SnoopCompile.jl/pull/334.