Open p-gw opened 5 months ago
On 0.1.5
:
Vector
:
julia> beta = (a = 1.0, b = 0.2, t = [0.0, 0.2, 1.0])
(a = 1.0, b = 0.2, t = [0.0, 0.2, 1.0])
julia> @benchmark irf(GPCM, $0.0, $beta)
BenchmarkTools.Trial: 10000 samples with 130 evaluations.
Range (min … max): 729.985 ns … 44.825 μs ┊ GC (min … max): 0.00% … 0.00%
Time (median): 758.169 ns ┊ GC (median): 0.00%
Time (mean ± σ): 835.101 ns ± 828.777 ns ┊ GC (mean ± σ): 2.49% ± 3.01%
▅█▆▅▄▄▃▂▂▁▁▁ ▂
██████████████▇███▇▇▇▆▇▆▆▇▆▆▆▅▆▆▅▆▆▆▆▆▆▆▆▆▆▅▄▅▄▃▄▄▁▅▅▄▁▅▄▄▃▄▄ █
730 ns Histogram: log(frequency) by time 1.76 μs <
Memory estimate: 352 bytes, allocs estimate: 12.
Tuple
:
julia> beta = (a = 1.0, b = 0.2, t = (0.0, 0.2, 1.0))
(a = 1.0, b = 0.2, t = (0.0, 0.2, 1.0))
julia> @benchmark irf(GPCM, $0.0, $beta)
BenchmarkTools.Trial: 10000 samples with 1000 evaluations.
Range (min … max): 75.112 ns … 7.717 μs ┊ GC (min … max): 0.00% … 98.78%
Time (median): 77.678 ns ┊ GC (median): 0.00%
Time (mean ± σ): 87.633 ns ± 104.845 ns ┊ GC (mean ± σ): 2.80% ± 4.08%
█▇▅▃▂▁▁▁▁ ▂
████████████▇▇▇▇▇▇▇▇▇▆▆▆▅▆▆▅▅▆▄▅▅▅▅▅▅▅▅▄▄▃▅▄▄▄▅▅▁▄▄▃▁▄▃▃▅▅▄▄ █
75.1 ns Histogram: log(frequency) by time 238 ns <
Memory estimate: 96 bytes, allocs estimate: 1.
Almost all functions require a call to
merge_pars
because low-level functions are only implemented for the most general cases.For polytomous models the
deepcopy
call inmerge_pars
requires allocations if a normal vector of thresholds is passed. Other variants are far more performant, e.g.Tuple
orStaticVector
:Vector
:Tuple
:SVector
: