[julia-users] Re: Repmat speed

2015-03-02 Thread Ivar Nesje
Fixing the type declarations for inner and outer (Array{Int,1} instead of Array{Int}), and isolating the type unstable R array filling in a extra function, cut the time down from 1.5 to 1 second. There are still a huge difference though. A ugly attempt is at

[julia-users] Re: Repmat speed

2015-03-02 Thread Simon Kornblith
Keyword arguments can add additional overhead when calling a function and prevent its return type from being inferred properly, but the code that runs is specialized for the types of the keyword arguments, so I don't think keyword arguments alone explain this. But it looks like there is some

[julia-users] Re: Repmat speed

2015-03-02 Thread antony schutz
Hi Steven, Thanks for your answer but my question is a bit different. I'm not asking about creating a mesh grid and how or why doing it. My question is more naive: Why the first method is faster than the 2 with only (well written) 1 line command. and a more general question is: why repeat is

[julia-users] Re: Repmat speed

2015-03-02 Thread Ivar Nesje
The speed difference is because Julia doesn't specialize for specific types for keyword arguments, and type unstable code creates really slow loops in Julia. Thanks for reporting, I'll work on a fix. mandag 2. mars 2015 09.09.04 UTC+1 skrev antony schutz følgende: Hi Steven, Thanks for

[julia-users] Re: Repmat speed

2015-02-27 Thread Steven G. Johnson
On Friday, February 27, 2015 at 9:11:10 AM UTC-5, antony schutz wrote: I have a question about the best way to implement a grid similar to a mesh grid: Note that you normally don't need mesh-grid like things, because you can use broadcasting operations instead. e.g. in order to compute

[julia-users] Re: Repmat speed

2015-02-27 Thread Eric Forgy
I learned something new. Thanks Steven :)