# Introduction
Code loading is 10x slower under Windows versus Windows Subsysβ¦tem for Linux 2 (WSL 2) on the same machine for large binary packages such as `GR_jll`:
```julia
julia> @time using GR_jll # Windows, Julia 1.6.0
0.734392 seconds (361.12 k allocations: 24.173 MiB, 0.53% compilation time)
julia> @time using GR_jll # WSL, Julia 1.6.0
0.066454 seconds (192.13 k allocations: 14.770 MiB, 4.94% compilation time)
```
The difference is not as much with smaller packages:
```julia
julia> @time using ImarisWriter_jll # Windows, Julia 1.6.0
0.274513 seconds (111.25 k allocations: 8.249 MiB, 1.31% compilation time)
julia> @time using ImarisWriter_jll
0.052826 seconds (64.77 k allocations: 5.350 MiB, 6.94% compilation time)
```
# Windows
```
julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
```
# Windows Subsystem for Linux
```
julia> versioninfo()
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)
```
# Profiling
## Protocol
```
julia> using Profile
julia> Profile.clear()
julia> @profile using GR_jll
```
## Windows Profile
```
julia> Profile.print(; maxdepth = 16)
Overhead β [+additional indent] Count File:Line; Function
=========================================================
β306 @Base\client.jl:485; _start()
β 306 @Base\client.jl:302; exec_options(opts::Base.JLOptions)
β 306 @Base\client.jl:372; run_main_repl(interactive::Bool, quiet::Bool, banner::B...
β 306 @Base\essentials.jl:706; invokelatest
β 306 @Base\essentials.jl:708; #invokelatest#2
β 306 @Base\client.jl:387; (::Base.var"#874#876"{Bool, Bool, Bool})(REPL::Module)
β β 306 ...julia\stdlib\v1.6\REPL\src\REPL.jl:305; run_repl(repl::REPL.AbstractREPL, consumer::Any)
β β 306 ...julia\stdlib\v1.6\REPL\src\REPL.jl:317; run_repl(repl::REPL.AbstractREPL, consumer::Any; bac...
β β 306 ...ulia\stdlib\v1.6\REPL\src\REPL.jl:185; start_repl_backend(backend::REPL.REPLBackend, consum...
β β 306 ...ulia\stdlib\v1.6\REPL\src\REPL.jl:200; repl_backend_loop(backend::REPL.REPLBackend)
β β 306 ...ulia\stdlib\v1.6\REPL\src\REPL.jl:139; eval_user_input(ast::Any, backend::REPL.REPLBackend)
1β β β 306 @Base\boot.jl:360; eval
β β β 305 @Base\loading.jl:901; require(into::Module, mod::Symbol)
β β β 305 @Base\loading.jl:914; require(uuidkey::Base.PkgId)
β β β 1 @Base\loading.jl:987; _require(pkg::Base.PkgId)
β β β 1 @Base\loading.jl:290; locate_package(pkg::Base.PkgId)
β β β β 1 @Base\loading.jl:396; manifest_uuid_path(env::String, pkg::Base.PkgId)
β β β 304 @Base\loading.jl:998; _require(pkg::Base.PkgId)
β β β 1 @Base\loading.jl:734; _require_search_from_serialized(pkg::Base.PkgId,...
β β β β 1 @Base\loading.jl:641; find_all_in_cache_path(pkg::Base.PkgId)
β β β 63 @Base\loading.jl:736; _require_search_from_serialized(pkg::Base.PkgId,...
β β β β 55 @Base\loading.jl:1716; stale_cachefile(modpath::String, cachefile::St...
β β β β 8 @Base\loading.jl:1750; stale_cachefile(modpath::String, cachefile::St...
β β β 2 @Base\loading.jl:741; _require_search_from_serialized(pkg::Base.PkgId,...
β β β β 2 @Base\file.jl:426; touch(path::String)
β β β 228 @Base\loading.jl:749; _require_search_from_serialized(pkg::Base.PkgId,...
β β β β 228 @Base\loading.jl:689; _tryrequire_from_serialized(modkey::Base.PkgId,...
β β β 10 @Base\loading.jl:760; _require_search_from_serialized(pkg::Base.PkgId,...
β β β β 10 @Base\loading.jl:674; _include_from_serialized(path::String, depmods:...
Total snapshots: 314
```
### Expansion of `@Base/loading:998` (maxdepth = 18)
```
β β β 304 @Base\loading.jl:998; _require(pkg::Base.PkgId)
β β β 1 @Base\loading.jl:734; _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
β β β β 1 @Base\loading.jl:641; find_all_in_cache_path(pkg::Base.PkgId)
β β β β 1 @Base\loading.jl:14; isfile_casesensitive(path::String)
1β β β β 1 @Base\path.jl:406; longpath(path::String)
β β β 63 @Base\loading.jl:736; _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
β β β β 55 @Base\loading.jl:1716; stale_cachefile(modpath::String, cachefile::String)
β β β β 9 @Base\loading.jl:0; locate_package(pkg::Base.PkgId)
β β β β 9 @Base\initdefs.jl:313; load_path()
β β β β 32 @Base\loading.jl:290; locate_package(pkg::Base.PkgId)
β β β β 8 @Base\loading.jl:388; manifest_uuid_path(env::String, pkg::Base.PkgId)
β β β β 5 @Base\loading.jl:390; manifest_uuid_path(env::String, pkg::Base.PkgId)
β β β β 17 @Base\loading.jl:396; manifest_uuid_path(env::String, pkg::Base.PkgId)
β β β β 2 @Base\loading.jl:399; manifest_uuid_path(env::String, pkg::Base.PkgId)
β β β β 14 @Base\loading.jl:291; locate_package(pkg::Base.PkgId)
β β β β 3 @Base\loading.jl:464; entry_path(path::String, name::String)
β β β β 11 @Base\loading.jl:466; entry_path(path::String, name::String)
β β β β 8 @Base\loading.jl:1750; stale_cachefile(modpath::String, cachefile::String)
β β β β 1 @Base\loading.jl:253; identify_package(where::Base.PkgId, name::String)
β β β β 1 @Base\initdefs.jl:313; load_path()
β β β β 7 @Base\loading.jl:254; identify_package(where::Base.PkgId, name::String)
β β β β 1 @Base\loading.jl:369; manifest_deps_get(env::String, where::Base.PkgId, name::String)
β β β β 2 @Base\loading.jl:372; manifest_deps_get(env::String, where::Base.PkgId, name::String)
β β β β 4 @Base\loading.jl:379; manifest_deps_get(env::String, where::Base.PkgId, name::String)
β β β 2 @Base\loading.jl:741; _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
β β β β 2 @Base\file.jl:426; touch(path::String)
β β β β 2 @Base\filesystem.jl:87; open(path::String, flags::UInt16, mode::UInt16)
β β β β 2 @Base\strings\io.jl:174; string
β β β 228 @Base\loading.jl:749; _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
β β β β 228 @Base\loading.jl:689; _tryrequire_from_serialized(modkey::Base.PkgId, build_id::UInt64, modpath::String)
β β β β 16 @Base\loading.jl:734; _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
β β β β 2 @Base\loading.jl:634; find_all_in_cache_path(pkg::Base.PkgId)
β β β β 1 @Base\loading.jl:635; find_all_in_cache_path(pkg::Base.PkgId)
β β β β 11 @Base\loading.jl:641; find_all_in_cache_path(pkg::Base.PkgId)
β β β β 2 @Base\loading.jl:647; find_all_in_cache_path(pkg::Base.PkgId)
β β β β 124 @Base\loading.jl:736; _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
β β β β 2 @Base\loading.jl:1691; stale_cachefile(modpath::String, cachefile::String)
β β β β 2 @Base\loading.jl:1693; stale_cachefile(modpath::String, cachefile::String)
β β β β 3 @Base\loading.jl:1697; stale_cachefile(modpath::String, cachefile::String)
β β β β 29 @Base\loading.jl:1716; stale_cachefile(modpath::String, cachefile::String)
β β β β 4 @Base\loading.jl:1744; stale_cachefile(modpath::String, cachefile::String)
β β β β 71 @Base\loading.jl:1750; stale_cachefile(modpath::String, cachefile::String)
β β β β 1 @Base\loading.jl:1759; stale_cachefile(modpath::String, cachefile::String)
β β β β 1 @Base\loading.jl:1767; stale_cachefile(modpath::String, cachefile::String)
β β β β 10 @Base\loading.jl:1773; stale_cachefile(modpath::String, cachefile::String)
β β β β 1 @Base\loading.jl:1784; stale_cachefile(modpath::String, cachefile::String)
β β β β 51 @Base\loading.jl:749; _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
β β β β 51 @Base\loading.jl:689; _tryrequire_from_serialized(modkey::Base.PkgId, build_id::UInt64, modpath::String)
β β β β 37 @Base\loading.jl:760; _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
6β β β β 6 @Base\loading.jl:658; _include_from_serialized(path::String, depmods::Vector{Any})
4β β β β 31 @Base\loading.jl:674; _include_from_serialized(path::String, depmods::Vector{Any})
β β β 10 @Base\loading.jl:760; _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
β β β β 10 @Base\loading.jl:674; _include_from_serialized(path::String, depmods::Vector{Any})
β β β β 10 @Base\libdl.jl:114; dlopen(s::String, flags::UInt32)
10β β β β 10 @Base\libdl.jl:114; dlopen(s::String, flags::UInt32; throw_error::Bool)
```
## Windows Subsystem for Linux Profile
```
julia> Profile.print(; maxdepth = 16)
Overhead β [+additional indent] Count File:Line; Function
=========================================================
β61 @Base/client.jl:485; _start()
β 61 @Base/client.jl:302; exec_options(opts::Base.JLOptions)
β 61 @Base/client.jl:372; run_main_repl(interactive::Bool, quiet::Bool, banner::Boo...
β 61 @Base/essentials.jl:706; invokelatest
β 61 @Base/essentials.jl:708; #invokelatest#2
β 61 @Base/client.jl:387; (::Base.var"#874#876"{Bool, Bool, Bool})(REPL::Module)
β β 61 .../julia/stdlib/v1.6/REPL/src/REPL.jl:305; run_repl(repl::REPL.AbstractREPL, consumer::Any)
β β 61 .../julia/stdlib/v1.6/REPL/src/REPL.jl:317; run_repl(repl::REPL.AbstractREPL, consumer::Any; backe...
β β 61 ...julia/stdlib/v1.6/REPL/src/REPL.jl:185; start_repl_backend(backend::REPL.REPLBackend, consume...
β β 61 ...julia/stdlib/v1.6/REPL/src/REPL.jl:200; repl_backend_loop(backend::REPL.REPLBackend)
β β 61 ...ulia/stdlib/v1.6/REPL/src/REPL.jl:139; eval_user_input(ast::Any, backend::REPL.REPLBackend)
1β β β 61 @Base/boot.jl:360; eval
β β β 60 @Base/loading.jl:901; require(into::Module, mod::Symbol)
β β β 60 @Base/loading.jl:914; require(uuidkey::Base.PkgId)
β β β 60 @Base/loading.jl:998; _require(pkg::Base.PkgId)
β β β 3 @Base/loading.jl:736; _require_search_from_serialized(pkg::Base.PkgId, ...
β β β β 3 @Base/loading.jl:1716; stale_cachefile(modpath::String, cachefile::String)
β β β 2 @Base/loading.jl:741; _require_search_from_serialized(pkg::Base.PkgId, ...
β β β β 2 @Base/file.jl:426; touch(path::String)
β β β 54 @Base/loading.jl:749; _require_search_from_serialized(pkg::Base.PkgId, ...
β β β β 54 @Base/loading.jl:689; _tryrequire_from_serialized(modkey::Base.PkgId, ...
β β β 1 @Base/loading.jl:760; _require_search_from_serialized(pkg::Base.PkgId, ...
β β β β 1 @Base/loading.jl:674; _include_from_serialized(path::String, depmods::...
Total snapshots: 68
```
### Expansion of `@Base/loading:998` (maxdepth = 18)
```
β β β 57 @Base/loading.jl:998; _require(pkg::Base.PkgId)
β β β 3 @Base/loading.jl:736; _require_search_from_serialized(pkg::Base.PkgId, ...
β β β β 3 @Base/loading.jl:1716; stale_cachefile(modpath::String, cachefile::String)
β β β β 1 @Base/loading.jl:0; locate_package(pkg::Base.PkgId)
β β β β 1 @Base/initdefs.jl:313; load_path()
β β β β 2 @Base/loading.jl:290; locate_package(pkg::Base.PkgId)
β β β β 2 @Base/loading.jl:396; manifest_uuid_path(env::String, pkg::Base.PkgId)
β β β 2 @Base/loading.jl:741; _require_search_from_serialized(pkg::Base.PkgId, ...
β β β β 2 @Base/file.jl:426; touch(path::String)
β β β β 2 @Base/filesystem.jl:87; open(path::String, flags::UInt16, mode::UInt16)
β β β β 2 @Base/strings/io.jl:174; string
β β β 52 @Base/loading.jl:749; _require_search_from_serialized(pkg::Base.PkgId, ...
β β β β 52 @Base/loading.jl:689; _tryrequire_from_serialized(modkey::Base.PkgId, ...
β β β β 9 @Base/loading.jl:736; _require_search_from_serialized(pkg::Base.PkgId,...
β β β β 4 @Base/loading.jl:1716; stale_cachefile(modpath::String, cachefile::St...
β β β β 4 @Base/loading.jl:1750; stale_cachefile(modpath::String, cachefile::St...
β β β β 1 @Base/loading.jl:1773; stale_cachefile(modpath::String, cachefile::St...
β β β β 1 @Base/loading.jl:741; _require_search_from_serialized(pkg::Base.PkgId,...
β β β β 1 @Base/file.jl:426; touch(path::String)
β β β β 27 @Base/loading.jl:749; _require_search_from_serialized(pkg::Base.PkgId,...
β β β β 27 @Base/loading.jl:689; _tryrequire_from_serialized(modkey::Base.PkgId,...
β β β β 15 @Base/loading.jl:760; _require_search_from_serialized(pkg::Base.PkgId,...
4β β β β 4 @Base/loading.jl:658; _include_from_serialized(path::String, depmods:...
5β β β β 11 @Base/loading.jl:674; _include_from_serialized(path::String, depmods:...
```