Dear all
I am Jesus Fernandez-Villaverde, one of the authors of the paper discussed here. The published paper is here:
https://www.sciencedirect.com/science/article/pii/S0165188915000883
It has some changes with respect to the working paper that some of you are discussing. Nothing of importance though.
Let me give you some context on our exercise (some of which has already been pointed out by other people). Our goal was to make a “fair” comparison among programming languages where “fair” needs to be understood as what your “average economist” would code. I happily admit that this criterium allows for a degree of subjectivity, but between my coauthor and me we have been in the community of research economists for nearly 40 years, so our assessment has a reasonable basis.
The idea was not, then, to compare the “best Julia” code against the “best C++” code, but to compare a “reasonably well-written Julia” code that is close to the math of the problem (coding time is usually more binding than running time in macroeconomics, and being close to the math formulation of the problem saves plenty of time) to a “reasonably well-written C++” code (or the other languages).
I would say that Julia came really well out of the comparison. It run nearly as fast as C++ and much faster than Matlab (the most common language in economics). Making the Julia code faster with aggressive optimization would have been, paradoxically, worse for Julia. The average economist would have seen a code that looked strange to her and, between 1.6 seconds and 1.1 seconds, she would not have care much. The main message of the paper was:
“Look: you can code something that looks nearly Matlab (so your transition costs are going to be low) and yet is way faster than Matlab, R, and Python and it does not force you to do all the dances of Numba or Cython.”
We believe that, in that dimension, the paper was really useful and made much to promote Julia among economists.
In my own course on High-Performance Computing for Economists, I show a RBC_fast.jl code where I squeeze all optimizations (including changing the log function) and I get the speed of C++. But the students are often quite puzzled by that code and prefer the original one: they can follow and understand it.
I just re-run a couple of weeks ago the whole exercise. Julia 0.6.2 still does very well. Matlab has improved a bit (they have work hard on speed over the last few releases). R has improved a lot.
Thanks again for all your comments