alan-turing-institute / PDSampler.jl

Piecewise Deterministic Sampler library (Bouncy particle sampler, Zig Zag sampler, ...)
Other
33 stars 8 forks source link

loading time #27

Open tlienart opened 7 years ago

tlienart commented 7 years ago

due to dependencies, loading time is quite slow (several seconds). Would be good to check how to strip down dependencies so that only the strict minimum is loaded in order to speed up loading.

tlienart commented 7 years ago

Experiments:

Current machine, full load time

 julia -e 'tic(); using PDMP; toc()'
elapsed time: 7.926201809 seconds

This is outrageous. Chasing the culprit.

In PDMP.jl:

using Compat
using Klara.ess
using ApproxFun

using Polynomials:
        Poly,
        roots,
        polyint,
        polyval
julia -e 'tic(); using Compat; toc()'
elapsed time: 0.047637768 seconds

Negligible

julia -e 'tic(); using Klara.ess; toc()'
elapsed time: 1.290301332 seconds

That's pretty bad

julia -e 'tic(); using ApproxFun; toc()'
elapsed time: 6.580165969 seconds

That's downright awful.

julia -e 'tic(); using Polynomials; toc()'
elapsed time: 0.062788019 seconds

Negligible again.

tlienart commented 7 years ago

Removing dependencies

julia -e 'tic(); using PDMP; toc()'
elapsed time: 1.567161443 seconds
tlienart commented 7 years ago

More informations:

  1. in Julia 0.5.2 it's half that time (changing Readme to reflect that for now recommended to use Julia 0.5.2 as a result)
  2. apparently the problem is partly known as per https://github.com/JuliaLang/julia/issues/21173