- I generated precompile statements via
generate_precompiles.jl
. - Then I
dev
'd each of Convex, MOI, and COSMO, and added the precompile statements. (See the SnoopCompile docs). - I removed the
ProblemDepot
specific precompiles from Convex, and added the SparseArray, Base (but minus the printing ones), and LinearAlgebra (minusisapprox
) precompiles to Convex too - Then I ran
test_precompiles.jl
, resulting inoutput.txt
- I ran it a second time, and saved the file as
output2.txt
.
E.g.,
include("generate_precompiles.jl")
# Now `dev` Convex, MOI, and COSMO, and add the precompile statements as above
include("test_precompiles.jl")
See output.txt
and output2.txt
for two runs of the timing test (which just solves one problem via readme_test
). It seems just adding precompile statements to COSMO reduces the first-solve time by 15-25 seconds. Adding precompile statements to MOI and Convex reduces it by another 4-8 seconds.
Adding precompile
statements will naturally increase precompilation time.
With the precompile statements, I get the following timings:
ephwork:COSMO eh540$ julia --project=.
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.3.1 (2019-12-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> @time using COSMO
[ Info: Precompiling COSMO [1e616198-aa4e-51ec-90a2-23f7fbd31d8d]
46.775588 seconds (18.79 M allocations: 1.028 GiB, 0.63% gc time)
julia> @time using COSMO
0.520894 seconds (1.04 M allocations: 49.060 MiB, 2.87% gc time)
julia> @time using COSMO
0.000238 seconds (359 allocations: 19.828 KiB)
ephwork:COSMO eh540$ julia --project=.
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.3.1 (2019-12-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> @time using COSMO
11.267857 seconds (17.62 M allocations: 995.843 MiB, 2.89% gc time)
julia> @time using COSMO
0.744716 seconds (1.04 M allocations: 49.060 MiB, 2.06% gc time)
julia> @time using COSMO
0.000240 seconds (359 allocations: 19.828 KiB)
Without precompile statements, I get the following times:
ephwork:COSMO eh540$ julia --project=.
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.3.1 (2019-12-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> @time using COSMO
[ Info: Precompiling COSMO [1e616198-aa4e-51ec-90a2-23f7fbd31d8d]
21.610615 seconds (17.64 M allocations: 971.520 MiB, 0.84% gc time)
julia> @time using COSMO
0.537329 seconds (1.04 M allocations: 49.061 MiB, 2.90% gc time)
julia> @time using COSMO
0.000260 seconds (359 allocations: 19.828 KiB)
julia>
ephwork:COSMO eh540$ julia --project=.
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.3.1 (2019-12-30)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |
julia> @time using COSMO
8.708156 seconds (16.46 M allocations: 914.094 MiB, 1.77% gc time)
julia> @time using COSMO
0.503618 seconds (1.04 M allocations: 49.061 MiB)
julia> @time using COSMO
0.000420 seconds (359 allocations: 19.828 KiB)