10 ms·
I didn't find it slow, but: $ time julia -e 'print(1)' 1 real 0m0.438s user 0m0.300s sys 0m0.118s $ time python -c 'print(1)'
by agumonkey 8y ago
I didn't find it slow, but:
$ time julia -e 'print(1)'
1
real 0m0.438s
user 0m0.300s
sys 0m0.118s
$ time python -c 'print(1)'
1
real 0m0.040s
user 0m0.036s
sys 0m0.003s
it is slower..
That said, instanciating julia every step of a bash loop.. I think it requires a jvm mindset, warmup once and iterate inside rather than outside.
- throwawaymath 8y agoTo demonstrate how slow the startup time is, here’s the respective times for executing ‘print(1)’ from Bash and from REPL on my machine: REPL: julia> @time print(1) 1 0.000031 seconds (7 allocations: 272 bytes) Bash: $ time ./julia -e 'print(1)' 1 real 0m0.184s user 0m0.156s sys 0m0.168s So yes, that’s a slow launch time. If you use Julia in a shell script and it’s starting up Julia on each calculation it will be brutally slow. Five orders of magnitude slower, in this case.
- agumonkey 8y agohonestly, parent had a use case in mind but it's ultra orthogonal with julia's goals. They're aiming at large numerical problems.. as I said above, if you need julia to make a quick one shot computation in a bash script loop, by all means use something else. But my bet is that anybody reading about julia is planning to do the heavy work inside of it, in which init time will probably be insignificant. It's a bit annoying it's true, a well featured language with dynamic/repl appeal that is not in the ms launch time. But alas..
- throwawaymath 8y agoTotally agreed, I'm a fan of Julia. I just wanted to comment with the delta between startup time and actual execution for passerby.
- enriquto 8y ago> I think it requires a jvm mindset, warmup once and iterate inside rather than outside. I do not have this mindset then. I prefer tools who are mindset oblivious. They are really useful! For example, imagine I have a collection of a few hundred images with their projection matrices (in text files). I want to crop them and apply a simple imagemagick operation (which is not available from inside julia). The elementary solution is to run a shell loop to apply the crop, and call julia to perform a simple adaptation of each projection matrix. This is impossible today: most of the running time of such loop is spent on julia initialization. Half a second to do nothing is simply unacceptable in a serious scripting language.
- pkofod 8y agoWhy can you not call you imagemagick operation from julia? Can't you just `run(``)` it?
- enriquto 8y agoThis is a part of a quite large system that does a lot of things. I do not want to wrap everything inside julia, that would force me to rewrite everything in julia. I just need to invert a few 4x4 linear systems from inside a shell script. I agree that this is not a very representative use case, and maybe it is irrelevant for most people. Yet, if I try to evangelize julia in my lab this problem blocks it, and it is better to stick to octave.
- agumonkey 8y agoI guessed that it wasn't your habits but if you step outside that box a bit you'll realize that lifting up or down things inside loops is the most natural thing to do. And for you example (which may not be your real use or workflow) you could have two loops, independent or coupled through a queue so that the julia process is only started once.
- enriquto 8y agoOf course! Once I realize that after a few seconds only a dozen images have been processed I cut the loop, remember that the julia repl is dog slow, and then, rewrite the task in a different way. But I would prefer not to have to do that. Moreover, for more complicated examples, there may be data dependencies that make the loop commutation non trivial. The slow startup time may be a minor inconvenience, I agree. But nonetheless it seems to be a case of sloppy engineering, as other scripting languages do not have this egregious problem. It sets a bad tone, and makes me wonder if there are other hidden monsters inside the interpreter, that may be solved by "you are holding it wrong" like this one.
- IshKebab 8y agoFirst of all that is ridiculously slow. Secondly, unlike Matlab you don't have everything you need available after starting the REPL. For instance if you want to plot something you might run `using Gadfly`. How long does that take? 16 seconds. Sixteen seconds. For real. This is not usable.
- agumonkey 8y agoHold on how long is MATLAB boot ?
- deleted 8y ago[deleted]