4 ms·
I recently tried to migrate my R code to Julia. Even though I already knew R data.table is faster than DataFrames.jl, I was totally blown away by how slow Julia
by temp8964 5y ago
I recently tried to migrate my R code to Julia. Even though I already knew R data.table is faster than DataFrames.jl, I was totally blown away by how slow Julia is. So I quickly gave up. I think I will have to write unavoidable hard loop in cpp, which I really don't want to do...
- glial 5y agoFor whatever it’s worth, I was pleasantly surprised at how easy Rcpp is to use.
- nojito 5y agoif it's grouping related check out the collapse package https://sebkrantz.github.io/collapse/ https://sebkrantz.github.io/collapse/
- xiaodai 5y agoyeah. time to first plot (ttfp) is a real issue.
- ku-man 5y agoMy experience as well. In order to get those so much vaunted C-like speeds the Julia fanboys claim, you need lots of contortions and hacks. Off the bat, Julia speeds are mediocre.
- cbkeller 5y agoThere are a few tricks to getting Julia to be actually fast, and while it's not hard per se if you know them all (at least for numerical work), it's definitely not trivial. IMHO, you really have to embrace dispatch-oriented programming, and that includes being scrupulous about avoiding type instability. You also have to be a bit conscious about allocations, since it's easy to write Julia code (especially if you're trying to write in a "vectorized" style as is common in R, Python, Matlab) that generates absurd numbers of allocations, which must then be garbage-collected. But also easy to avoid those allocations if you know. It took about two years, but after picking up more of this, I was eventually able to switch everything my group does from a two-language solution of matlab for scripts and plotting and C (with MPI) for HPC to all-Julia. This [1] was originally targeted at academics making the same switch, but much of it could be relevant to those with an R background as well. [1] https://github.com/brenhinkeller/JuliaAdviceForMatlabProgrammers https://github.com/brenhinkeller/JuliaAdviceForMatlabProgram...