Closed8

PrecompileTools.jlを使ってみる

HyrodiumHyrodium

https://github.com/hyrodium/BasicBSpline.jl/pull/337
初回実行めっちゃ高速化できてワロタ

6.380801 seconds → 0.000400 seconds

Before this PR

julia> using BasicBSpline

julia> P = BSplineSpace{3}(KnotVector(1:12))
BSplineSpace{3, Int64, KnotVector{Int64}}(KnotVector([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]))

julia> @time changebasis_I(P,P)
  6.380801 seconds (7.65 M allocations: 497.300 MiB, 2.12% gc time, 100.00% compilation time)
8×8 SparseArrays.SparseMatrixCSC{Float64, Int32} with 8 stored entries:
 1.0   ⋅    ⋅    ⋅    ⋅    ⋅    ⋅    ⋅ 
  ⋅   1.0   ⋅    ⋅    ⋅    ⋅    ⋅    ⋅ 
  ⋅    ⋅   1.0   ⋅    ⋅    ⋅    ⋅    ⋅ 
  ⋅    ⋅    ⋅   1.0   ⋅    ⋅    ⋅    ⋅ 
  ⋅    ⋅    ⋅    ⋅   1.0   ⋅    ⋅    ⋅ 
  ⋅    ⋅    ⋅    ⋅    ⋅   1.0   ⋅    ⋅ 
  ⋅    ⋅    ⋅    ⋅    ⋅    ⋅   1.0   ⋅ 
  ⋅    ⋅    ⋅    ⋅    ⋅    ⋅    ⋅   1.0

After this PR

julia> using BasicBSpline

julia> P = BSplineSpace{3}(KnotVector(1:12))
BSplineSpace{3, Int64, KnotVector{Int64}}(KnotVector([1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]))

julia> @time changebasis_I(P,P)
  0.000400 seconds (2.73 k allocations: 249.469 KiB)
8×8 SparseArrays.SparseMatrixCSC{Float64, Int32} with 8 stored entries:
 1.0   ⋅    ⋅    ⋅    ⋅    ⋅    ⋅    ⋅ 
  ⋅   1.0   ⋅    ⋅    ⋅    ⋅    ⋅    ⋅ 
  ⋅    ⋅   1.0   ⋅    ⋅    ⋅    ⋅    ⋅ 
  ⋅    ⋅    ⋅   1.0   ⋅    ⋅    ⋅    ⋅ 
  ⋅    ⋅    ⋅    ⋅   1.0   ⋅    ⋅    ⋅ 
  ⋅    ⋅    ⋅    ⋅    ⋅   1.0   ⋅    ⋅ 
  ⋅    ⋅    ⋅    ⋅    ⋅    ⋅   1.0   ⋅ 
  ⋅    ⋅    ⋅    ⋅    ⋅    ⋅    ⋅   1.0
HyrodiumHyrodium

当初の目的だったStaticArrays.jlのPRも確認できたのでmergeしました。以前の_precompile_()とか謎だったので、その辺りが整備されたのは嬉しい

このスクラップは2023/10/28にクローズされました