Hacker News new | ask | show | jobs
by MisterBiggs 1908 days ago
No idea if this is really a fair comparison but just to get a brief idea of current speeds:

   julia> @time let
          using Plots
          plot([sin, cos])
          end
        11.267558 seconds (17.98 M allocations: 1.114 GiB, 4.83% gc time)
Versus Matlab which probably takes about 15 seconds just to open the editor but plotting is very fast.

   >> tic
   fplot( @(x) [sin(x) cos(x)])
   toc
   Elapsed time is 0.374394 seconds.
Julia is just about as fast as Matlab after the first run for plotting.
2 comments

I wonder how much Julia could be helped with some uneval/image-saving magic. So when you run the repl you instead get a pre-built binary with plot already loaded and several common specialisations already compiled.
We call these "system images" and you can generate them with PackageCompiler [0]. Unfortunately, it's still a little cumbersome to create them, but this is something that we're improving from release to release. One possible future is where an environment can be "baked", such that when you start Julia pointing to that environment (via `--project`) it loads all the packages more or less instantaneously.

The downside is that generating system images can be quite slow, so we're still working on ways to generate them incrementally. In any case, if you're inspired to work on this kind of stuff, it's definitely something the entire community is interested in!

[0] https://github.com/JuliaLang/PackageCompiler.jl

Easy, you only have to add a handful of „battery included“ packages to the default system image.

That however means that some packages get a preferred status in the Julia ecosystem.

> Matlab which probably takes about 15 seconds just to open the editor

Try this:

matlab -nosplash -nodesktop -r "tic; fplot( @(x) [sin(x) cos(x)]); toc"

This took 25 seconds on my laptop (15 seconds the second time, when the filesystem was warm).
I believe that's still not going to capture the startup time of Matlab itself, right?
It's faster than opening the editor, though.