[julia-users] Re: Julia vs C++-11 for random walks

2015-01-06 Thread Frank Kampas
Microsoft C code is not very fast these days. You might want to compare with MinGW. On Monday, January 5, 2015 9:56:07 AM UTC-5, lapeyre@gmail.com wrote: Hi, here is a comparison of Julia and C++ for simulating a random walk https://github.com/jlapeyre/ranwalk-Julia-vs-Cxx. It is the

Re: [julia-users] Re: Julia vs C++-11 for random walks

2015-01-05 Thread lapeyre . math122a
It may be in part the implementation of the RNG. I think it is also in part whether the abstraction is optimized away. Notice that Julia v0.3 is faster than v0.4. This is probably randbool() vs. rand(Bool). On Monday, January 5, 2015 4:50:56 PM UTC+1, Isaiah wrote: Very neat. Just in case

Re: [julia-users] Re: Julia vs C++-11 for random walks

2015-01-05 Thread Viral Shah
I doubt that rand(Bool) is any slower, since randbool() calls rand(Bool). It is worth filing this as a performance regression. -viral On Monday, January 5, 2015 9:41:45 PM UTC+5:30, lapeyre@gmail.com wrote: It may be in part the implementation of the RNG. I think it is also in part

Re: [julia-users] Re: Julia vs C++-11 for random walks

2015-01-05 Thread lapeyre . math122a
I meant randbool() in v0.3, where it was a more direct call, not randbool() in v0.4. Anyway, I just found the problem and patched it. Adding one '@inline' now makes rand(Bool) in v0.4 about as fast as randbool() in v0.3. Should I open an issue (bug report), or just make a PR ? On Monday,

Re: [julia-users] Re: Julia vs C++-11 for random walks

2015-01-05 Thread Viral Shah
Thanks. Do create a PR. -viral On 06-Jan-2015, at 1:53 am, lapeyre.math1...@gmail.com wrote: I meant randbool() in v0.3, where it was a more direct call, not randbool() in v0.4. Anyway, I just found the problem and patched it. Adding one '@inline' now makes rand(Bool) in v0.4 about

[julia-users] Re: Julia vs C++-11 for random walks

2015-01-05 Thread lapeyre . math122a
Oh, and, (I forgot to mention!) the Julia code runs much faster. On Monday, January 5, 2015 3:56:07 PM UTC+1, lapeyre@gmail.com wrote: Hi, here is a comparison of Julia and C++ for simulating a random walk https://github.com/jlapeyre/ranwalk-Julia-vs-Cxx. It is the first Julia program

Re: [julia-users] Re: Julia vs C++-11 for random walks

2015-01-05 Thread Isaiah Norton
Very neat. Just in case this gets posted to the interwebz, it is worth pointing out that the performance advantage for Julia can probably be explained by differences in the underlying RNG. We use dsFMT, which is known to be one of (if not the?) fastest MT libraries around. I could not find any

Re: [julia-users] Re: Julia vs C++-11 for random walks

2015-01-05 Thread lapeyre . math122a
Ok. It's done. Just to be sure I understood what I read on a github forum; there is no way for me to attach a label to the PR. So the labels are always added by someone else ? --John On Monday, January 5, 2015 9:25:18 PM UTC+1, Viral Shah wrote: Thanks. Do create a PR. -viral On