Open PallHaraldsson opened 5 hours ago
precompile(Tuple{typeof(Base.setindex!), Base.EnvDict, Bool, String})
I guess this is from your startup file?
Ideally these would have no allocations at runtime, nor at compile-time, i.e. since it should be eliminated...
As you have seen (https://github.com/JuliaLang/julia/pull/38227), currently printing bitstype
requires an allocation because of some internal reason that it passes something as a pointer.
YES! Base.EnvDict now redacted from the top, it was a distraction (not changing the conclusion), I usually do not forget --startup-file=no and only this was in my file:
1+2
ENV["JULIA_PKG_PRESERVE_TIERED_INSTALLED"] = false # true
A. That PR is (upcoming, unless it slightly modified for this) 1.11.1:
Both seem to miss the same types of precompiles, and I'm not sure if it's println vs print (and for what reason; slower to compile first) and/or Int[64] vs UInt64. Would be nice to figure out and fix before 1.11.1... (or 1.11.2 or 1.12).
This sort of thing is common to most programs, so argument for being precompiled into the sysimage? Will it bloat it much, even slow the above down?
B. Note, faster AND also fewer allocations:
Ideally these would have no allocations at runtime, nor at compile-time, i.e. since it should be eliminated...
You might think with Char, '\n', faster, but it has actually 1-2 allocations more (non-ideal for explaining optimal code [for benchmarks...]):
C.
Strange optimization saving (an allocation):