statistics-using-python icon indicating copy to clipboard operation
statistics-using-python copied to clipboard

bootstrap samples in statistics

Open siliconMagic opened this issue 7 years ago • 1 comments

siliconMagic avatar Oct 12 '18 04:10 siliconMagic

Add this copied message from slack for a moment:

Here's what I would do:
First, make a "representative workload" for your package. Something that uses the most common latency-sensitive functions. This is probably what you have inside your SnoopPrecompile block?
Put this workload inside a function, then check it's type stable with JET's report_opt . Make type stable as necessary
Check for type piracy. This can be automated using this script here: https://discourse.julialang.org/t/piracy-hunting/90119. Remove all piracy you find

roflmaostc avatar Nov 22 '22 17:11 roflmaostc

Julia 1.9:

# without precomp
julia> @time @eval begin
               using FourierTools; resample(randn((3,3)), (4,4));
              end
  2.347064 seconds (7.83 M allocations: 521.891 MiB, 7.21% gc time, 71.20% compilation time)


julia> @time @eval begin
               using FourierTools
              end
  0.667420 seconds (1.51 M allocations: 101.459 MiB, 6.05% gc time, 0.93% compilation time)




# with precompile

julia> @time @eval begin
               using FourierTools
              end

  0.896489 seconds (2.05 M allocations: 141.270 MiB, 6.69% gc time, 0.69% compilation time)


julia> @time @eval begin
               using FourierTools; resample(randn((3,3)), (4,4));
              end
  1.032369 seconds (2.35 M allocations: 160.550 MiB, 6.08% gc time, 13.95% compilation time)
4×4 Matrix{Float64}:
 1.40546     -1.01361   -0.690086  1.72899
 0.0448578   -1.07521   -0.575482  0.544589
 0.00392657  -0.224145   1.05394   1.28201
 1.36453     -0.162546   0.939333  2.46641

``

roflmaostc avatar Mar 21 '23 14:03 roflmaostc