Here is a small example to reproudce this problem:
- create a package and define a new Type;
- define
convert method for convert this new Type to Type Nothing;
- estimate loading time with
using MyPkg twice, the second time using is very very slow and looks like doing recompilation;
Julia Version: 1.9.3
OS: I reproduce this problem in both Win10 && Unbuntu
module MyPkg
struct MyCls end
Base.convert(::Type{Nothing}, x::MyCls) = 1
end # module MyPkg
julia> @time using MyPkg
0.015626 seconds (8.70 k allocations: 582.849 KiB)
julia> @time using MyPkg
2.311770 seconds (1.30 M allocations: 91.081 MiB, 3.68% gc time, 99.92% compilation time: 100% of which was recompilation)