5 ms·
My primary issue with Julia is that it has a relatively high latency in a REPL environment. I and many people I know primarily use REPL environments (e.g. Jupyt
by aurelian15 8y ago
My primary issue with Julia is that it has a relatively high latency in a REPL environment. I and many people I know primarily use REPL environments (e.g. Jupyter Lab) for scientific computing, so this is a pretty relevant use-case. For example, if I start Julia and type
[1 2 3; 4 5 6; 7 8 9] ^ 2
I have to wait about 5 seconds for a response (on a first generation Core i7, SSD). On the other hand, running the following in a fresh Python interpreter is almost instantaneous:
import numpy as np
np.linalg.matrix_power([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 2)
Unfortunately, in most scenarios the actual execution speed (where Julia is far superior) is secondary. People just tend to run larger experiments over night; and as long as you can express your code in terms of numpy matrix operations, Python is fast enough.
- StefanKarpinski 8y agoThat taking 5 seconds is very strange. I have an early Core M (mobile laptop chip, much slower than Core i7, which is a desktop chip) and that expression takes 0.7 seconds at a fresh prompt. That's still much worse JIT compilation delay than we'd like it to be, but 5 seconds is either a very bad configuration or perhaps a bit of hyperbole? There are other situations like time-to-first-plot where compile times do cause a really serious delay that is a very real problem—and a top priority to fix.
- aurelian15 8y agoTried again this morning after rebooting the computer -- turns out I was low on RAM yesterday evening. After starting Julia a few times to make sure it is cached I get the following results: time julia -e '[1 2 3; 4 5 6; 7 8 9] ^ 2' real 0m1.629s And for Python/Numpy time python -c 'import numpy as np; print(np.linalg.matrix_power([[1, 2, 3], [4, 5, 6], [7, 8, 9]], 2))' real 0m0.103s Edit: Julia Version is 0.6.3, installed directly from the Fedora 28 repositories.
- b2gills 8y agoAnd people think Perl 6 is slow time perl6 -e 'say [1, 2, 3; 4, 5, 6; 7, 8, 9] >>**>> 2' [(1 4 9) (16 25 36) (49 64 81)] real 0m0.170s Note that the majority of that time is just loading Perl 6. time perl6 -e 'Nil' real 0m0.156s Perhaps someone could create a slang module for Julia in Perl 6, as that would be a fairly easy way to improve its speed. (Assuming Julia is easy to parse and doesn't have many features that aren't already in Perl 6)
- goatlover 8y ago> For example, if I start Julia and type [1 2 3; 4 5 6; 7 8 9] ^ 2' Put that in a function and run it twice. The second time will be blazing fast since it's jitted. That's the workaround for REPL/Notebook usage. In my experience with Notebooks, I end up having to rerun the code all the time, so it will only be slow the first time around. And I've had my share of Python code that took 5 seconds or more to complete, every single time.
- montalbano 8y agoJust tried this on my (much slower) Intel m3-6Y30 (microsoft surface) processor and it worked in just over a second. What Julia version are you running? Speed has been improving steadily with new releases. > Unfortunately, in most scenarios the actual execution speed (where Julia is far superior) is secondary. People just tend to run larger experiments over night; I don't think there are only two scenarios, one requiring instant feedback and dependent on fast startup time, and the other where programs can be run overnight. There are infinite cases in-between. And crucially what about programs that take several days if not weeks (such as the biomechanical data analysis I do in my work)? Execution speed for me (and many others) is essential and doing this work in Python is a pain (I was using it for the same kind of problems before I switched to Julia).