Closed tpapp closed 6 years ago
Benchmarking before (my laptop, at 93a66ea):
using Statistics
using TransformVariables
using BenchmarkTools
BenchmarkTools.DEFAULT_PARAMETERS.samples = 1000
function time_random(t; N = 50)
b̄ = mean([(x = randn(dimension(t));
print(".");
@belapsed transform_and_logjac($t, $x)) for _ in 1:N])
println()
b̄
end
ts = to_tuple(to_ℝ₊, to_𝕀, to_unitvec(5), to_corr_cholesky(4))
julia> time_random(ts)
..................................................
9.972157615325521e-7
New setup (69d9535):
julia> time_random(ts)
..................................................
1.0685129903332343e-6
Should investigate further later, this is good enough for now.
Fixed by #10.
Instead of
transform_at
getting a vector and an index, a view would be easier to handle for user extensions. Proposed name:transform_with(flag, t, x)
.