Implications of --compile=min and --optimize=0, for dummies

kevbonham
Wed, 10 Mar 2021 15:46:02 +0000
Performance

I’m starting to build some command line interfaces for some projects, and trying to figure out the best practices. In Fredrik Ekre’s juliacon talk, he recommends one option is to use --compile=min --optimize=0, but I’m trying to figure out what the implications / trade-offs of these flags are.

Certainly, for development purposes, they reduce lag time considerably; I tend to use ArgParse.jl, and in one example, julia myscript.jl --help takes 6 seconds without those flags, and 0.3 sec with them. A bunch of my scripts are just doing things like calling external programmings and some file administration, and in those cases, it also seems like a no-brainer.

But if I’m actually using julia packages to do numerically-intensive work, am I going to be shooting myself in the foot? I’ve tried to do a bit of reading, but I really don’t understand the low-level stuff enough to make heads or tails of it. Is compile=min just deferring compilation that will happen anyway later on, so it makes no difference in something that isn’t interactive? Or is there a cost that will be paid over time? Can someone do a “optimization for dummies” explanation?

In the end, I’m sure I should just use PackageCompiler, but I’m still pretty early in development and that seems like a heavier lift than just passing some command line flags. It would be nice to have a better sense of the implications of these things, if someone that understands it can volunteer

PS - yes, I also know DaemonMode.jl is an option and I’m playing with that too.

23 posts - 10 participants