MilesCranmer / DispatchDoctor.jl

The dispatch doctor prescribes type stability
Apache License 2.0
128 stars 6 forks source link

Add `codegen_level` parameter for minimal codegen #26

Closed MilesCranmer closed 1 month ago

MilesCranmer commented 1 month ago

Reduces precompilation time increase noted by @thofman

This allows you to set default_codegen_level="min" which will avoid duplicating function bodies, without affecting anything else. The reason for the function body duplication is literally just to get @code_warntype working, but nothing else.

There is also a Preferences.jl key for it: instability_check_codegen (which overrides the default).

With default_codegen_level="min", you can't use @code_warntype. So the default is "debug". But if you are building a massive library, I can totally see "min" being useful to cut down compilation time.

coveralls commented 1 month ago

Coverage Status

coverage: 100.0%. remained the same when pulling 23204a2e283579b54606ab3bd24eefb0ea732094 on min-codegen into 62327d5df8fb0002d6dcd578158eddab504abb4c on main.