Closed
Description
In a fresh julia 1.7 session
julia> @time using MLDatasets
13.485246 seconds (20.31 M allocations: 1.158 GiB, 7.56% gc time, 61.69% compilation time)
Is there a way to conditionally import packages?
julia> for pkg in [:ImageCore, :CSV, :HDF5, :JLD2, :JSON3]; print(pkg); @time @eval using $pkg; end
ImageCore 2.141235 seconds (3.02 M allocations: 200.377 MiB, 4.50% gc time, 32.08% compilation time)
CSV 3.817959 seconds (6.14 M allocations: 348.493 MiB, 9.81% gc time, 90.11% compilation time)
HDF5 0.723358 seconds (1.34 M allocations: 73.225 MiB, 1.69% gc time, 93.80% compilation time)
JLD2 1.139716 seconds (1.36 M allocations: 78.966 MiB, 3.95% gc time, 60.77% compilation time)
JSON3 0.033367 seconds (49.09 k allocations: 3.014 MiB)
julia> for pkg in [:DataFrames, :MLUtils, :Pickle, :NPZ, :MAT]; print(pkg); @time @eval using $pkg; end
DataFrames 1.789793 seconds (2.03 M allocations: 137.197 MiB, 4.63% gc time)
MLUtils 1.743072 seconds (2.07 M allocations: 117.900 MiB, 4.83% gc time, 47.32% compilation time)
Pickle 0.130685 seconds (159.17 k allocations: 9.751 MiB, 17.77% compilation time)
NPZ 0.504406 seconds (1.19 M allocations: 61.838 MiB, 4.05% gc time, 98.87% compilation time)
MAT 0.009792 seconds (22.84 k allocations: 1.044 MiB)
Related discourse thread
Metadata
Metadata
Assignees
Labels
No labels