I just added precompilation directives (using PrecompileTools) to a package, and in Julia 1.6 a bunch of tests started failing because, with the precompilation directives a series of functions start allocating, while without them the functions do not allocate.
I can reproduce the problem exactly: remove the precompilation directives, the tests pass (the functions do not allocate). Add the precompilation directives, the functions start allocating and the tests fail.
That happens in 1.6 but not 1.10. In 1.10 I have no such issues.
So, I have two questions:
1) Is this something known? I find hard to even start debugging that.
2) How can precompilation affect the behavior of a function?
(currently just worked around that by only precompiling if version > 1.9, but still the observation is strange)
It's certainly known. See e.g. https://github.com/JuliaLang/julia/issues/35972.
Leandro Martínez has marked this topic as resolved.
Last updated: Dec 28 2024 at 04:38 UTC