Chad Scherrer

Results 380 comments of Chad Scherrer

I think see what you mean @peteroupc. Julia's `Base` wraps all of this so you can ask for random numbers of any type. In principle, it could sometimes be useful...

> What do you think of going the way of GaussianDistributions.jl and have one object for 1d and nd Gaussians? It's an interesting idea, my only concerns would be 1....

Good idea to check this, @mohamed82008 I'm already on Julia 1.6. Here's the result if I remove the `@simd`: ```julia julia> @btime logdensity($d_fill, $x) 130.726 ns (0 allocations: 0 bytes)...

Even weirder, I'm having trouble reproducing this outside of MeasureTheory. I'd think that could mean I'm adding the overhead somewhere. But the implementation is very simple: ```julia Base.:^(μ::AbstractMeasure, n::Integer) =...

This is in the dev branch. Things are a little out of sync though. I'll update and let you know

Ok it's updated. Try this: ```julia using MeasureTheory using BenchmarkTools d_fill = Normal(2.0,5.0) ^ 20 d_mapped = For(1:20) do i Normal(2.0, 5.0) end x = rand(d_fill); @btime logdensity($d_fill, $x) @btime...

And thanks for having a look :)

That makes sense, thank you! MappedArrays are more flexible than FillArrays. If they're also higher performance because of this, maybe we should just never use `Fill`?

Do you see this as pointing to any changes needed in FillArrays to be help things compile away?

Ok, I guess the big question then is if there are cases where the `Fill` is much faster. If it's always either that they're close or `MappedArray` is the easy...