News for hackers. Stuff that matters.
Re:Julia 1.5 Highlights by m0zg on Monday August 03, 2020 @01:17PM (#24040536)
> the time to generate the first plot goes from 11.7 seconds to 7.8 seconds

This should not take more than 100 milliseconds in this day and age, folks.

Re:Julia 1.5 Highlights by gajomi on Monday August 03, 2020 @01:37PM (#24040809)
FYI this is the _first_ call which is dominated by the JIT process. So not really "this time to plot" so much as the "time to compile". Calls to the resulting jitted function will be on the order of what you quote (I have not timed myself for the specific result they quote here but have done for similar in the past).
Re:Julia 1.5 Highlights by m0zg on Monday August 03, 2020 @01:39PM (#24040828)
I know. Be that as it may, 7 seconds to load a module alone is nuts.
Re:Julia 1.5 Highlights by Certhas on Monday August 03, 2020 @01:41PM (#24040861)
The module also gets partially precompiled on load. If you make the module part of the systemimage it's as quick as you would expect.
Re:Julia 1.5 Highlights by bananaquant on Monday August 03, 2020 @05:08PM (#24043438)
Ha. I remember the time when it took over a minute.
Re:Julia 1.5 Highlights by muska3 on Monday August 03, 2020 @01:49PM (#24040966)
Sadly, this is very true. Yeah Julia is fast, but not as fast as python and matlab in the REPL and quick analysis work. I can get going with data analysis and plotting far faster for exploratory work due to the zero precompilation overhead in those languages, where as in Julia this overhead is brutal. Julia people will probably down-vote this, but sadly, as an interactive language this is it's Achilles heel. I have to explain to people why the code is taking so long to show up due to JIT et al., and non-experts don't understand that this is just an initial overhead.
Re:Julia 1.5 Highlights by pjmlp on Tuesday August 04, 2020 @02:00AM (#24047094)
When one doesn't have a JIT and every piece of code that requires performance has to be rewritten in C, it is easy to be "fast".
Re:Julia 1.5 Highlights by smabie on Monday August 03, 2020 @08:56PM (#24045355)
I agree that it's annoying, but creating a image isn't very difficult and solves the problem nicely.
Re:Julia 1.5 Highlights by zchristensen7 on Monday August 03, 2020 @05:08PM (#24043444)
To be fair, this metric represents the absolute worse case scenario for latency in Julia. Even before 1.5 you could technically get a first plot in less than 7.8 seconds using SimplePlots.jl. This also doesn't speak to the performance once you have your first plot. I've crashed my computer a good number of times using Matlab or R to interactively manipulate a complicated 3D structure. I was able to add some crazy stuff to my plots before this happened in Julia.
Re:Julia 1.5 Highlights by moelf on Monday August 03, 2020 @02:24PM (#24041422)
with PackageCompiler.jl, you can do this within 100 ms
Re:Julia 1.5 Highlights by notthemessiah on Monday August 03, 2020 @03:13PM (#24042064)
Alternatively, you could run it with --compile=min and --optimize=0 to minimize latency at the cost of runtime performance (making it comparable to Python).

jlpkg does this to speed up package installation: https://github.com/fredrikekre/jlpkg https://live.juliacon.org/talk/N39HSX

Re:Julia 1.5 Highlights by m0zg on Monday August 03, 2020 @02:54PM (#24041816)
Why is this not the default?
Re:Julia 1.5 Highlights by improbable22 on Monday August 03, 2020 @03:09PM (#24042002)
This bakes in a particular version of the Plots library. Which is mostly great, but you need to re-bake to move on to a new version.

(All the standard libraries are baked in by default, in much the same way I think, and so can't be updated without making a new version of Julia. But they all load fast.)

Re:Julia 1.5 Highlights by eigenspace on Monday August 03, 2020 @03:11PM (#24042040)
Because it involves making a julia sysimage with the Plots.jl functions AOT compiled into it. PackageCompiler.jl makes this quite easy and straightforward though, it takes like 5 minutes and you won't have to worry about plotting latency again until you upgrade Julia or Plots.jl.

Here's the instructions: https://julialang.github.io/PackageCompiler.jl/dev/examples/...

Re:Julia 1.5 Highlights by m0zg on Monday August 03, 2020 @03:30PM (#24042253)
Why doesn't it cache the results of a compilation automatically the first time you hit the module after any change? This shouldn't be difficult. Much of Julia's target audience don't know what "AOT" is.
Re:Julia 1.5 Highlights by eigenspace on Monday August 03, 2020 @03:55PM (#24042564)
> This shouldn't be difficult.

It is actually exceedingly difficult due to multiple dispatch. There's an effectively infinite number of different method signatures a function can have.

Currently, anything you want to AOT needs to go into a big monolithic sysimage with the full julia runtime. We might be able to eventually do a shared library approach that you can dynamically link to, but it'll take time.

Doing this automatically without the user opting in would make latency problems worse, not better.

Re:Julia 1.5 Highlights by heyitsme on Monday August 03, 2020 @04:12PM (#24042764)
does that mean that if one starts a new julia kernel, and imports a package, something different happens each time they do that? if not, then it would seem one could at least save on those super long imports. Reading about this a bit more, it almost seems like whatever PackageCompiler.jl is doing could be automated and baked into the the core julia executable with simple options/flags.
Re:Julia 1.5 Highlights by eigenspace on Monday August 03, 2020 @04:36PM (#24043082)
There will likely be more caching in the future, but it's a hard problem and for now, they're working on lower hanging fruit to speed up compile times.

> Reading about this a bit more, it almost seems like whatever PackageCompiler.jl is doing could be automated and baked into the the core julia executable with simple options/flags.

Not really, no. Fundamentally, PackageCompiler is building a monolithic executable with your desired packages baked into it. Every time you want to add a new method to compile, you need to rebuild the whole thing and you cause it to be larger on the disk and slower to start up.

Even if we could quickly cache methods, I have hundreds of Julia packages installed locally on my machine. and regularly call methods with exotic signatures. If I baked every method I ever compiled into my sysimage, it'd probably be hundreds of terabytes in size at least. You have to remember that every time I call a function f on arguments x, y, and z, I need to compile a new method for each distinct signature

    f(::typeof(x), ::typeof(y), ::typeof(z))
There are more Julia function signatures that it's possible to create and compile from just Base functions and types than there are atoms in the universe.

Of course, it's possible to do more caching and faster than we currently do, but I just want to emphasize that it's a hard problem.

Re:Julia 1.5 Highlights by djaque on Monday August 03, 2020 @02:19PM (#24041342)
This is the info I was looking for. Julia is such an awesome language, but I can't use it due to latency. As soon as this gets fixed I would switch over all of my data analysis in a heartbeat.
Re:Julia 1.5 Highlights by eigenspace on Monday August 03, 2020 @02:32PM (#24041523)
I don't think this is a great reason to avoid julia.

Why is latency a concern for you? Are you running a lot of short, one-off scripts? If so, an easy solution is to just keep a julia session running and re-use it for each each script rather than constantly starting up and closing julia sessions. DaemonMode.jl [1] is a package that was recently developed that makes this workflow effortless.

Another option if you've got some production code that needs to be run over and over again is to create a custom sysimage with everything AOT compiler. PackageCompiler.jl [2] makes this workflow pretty easy nowadays.

[1] https://github.com/dmolina/DaemonMode.jl

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

Re:Julia 1.5 Highlights by tastyminerals on Monday August 03, 2020 @03:41PM (#24042381)
What?! There are static languages that compile faster: Nim, D... Honestly, I used ggplotD library and it takes roughly two seconds to compile and miliseconds to show the plot.
Re:Julia 1.5 Highlights by fermienrico on Monday August 03, 2020 @03:28PM (#24042221)
Most people who advocate Julia have never built production ready systems.
Re:Julia 1.5 Highlights by jonniedie on Monday August 03, 2020 @04:58PM (#24043328)
Most people who talk about “production ready systems” have never had to do any serious numerical work.
Re:Julia 1.5 Highlights by eigenspace on Monday August 03, 2020 @05:20PM (#24043604)
I might have to steal this quote.
Re:Julia 1.5 Highlights by tomkwong on Monday August 03, 2020 @06:34PM (#24044274)
This statement is so wrong. I am using Julia for at least two mission-critical production systems by now (financial services industry). I have a complete dev ops workflow plus integration with enterprise databases, messaging systems, and cloud resources.
Re:Julia 1.5 Highlights by eigenspace on Monday August 03, 2020 @03:56PM (#24042582)
Most people who advocate anything have never built production ready systems because that's not a thing most people do. There are important and knowledgeable people in the Julia community who build production ready systems as their full time jobs though.

What is your point?

Re:Julia 1.5 Highlights by fermienrico on Monday August 03, 2020 @04:32PM (#24043026)
I disagree. If a language is positioning itself as a python alternative, it needs to handle production readiness. If I were to guess, python is used in more production environments than in prototyping environments, but I don't have data to prove. What's most likely true is that production systems aren't a minuscule portion of a language's application - it is a significant chunk and Julia just isn't there yet. Hopeful though.
Re:Julia 1.5 Highlights by eigenspace on Monday August 03, 2020 @04:49PM (#24043217)
> If I were to guess, python is used in more production environments than in prototyping environments.

Then you have a stunning misunderstanding of Python's demographics.

Re:Julia 1.5 Highlights by fermienrico on Monday August 03, 2020 @09:23PM (#24045522)
I’d be curious if you have data. Also, if we define execution of a Python line as a metric: Instagram alone will dwarf all prototypers in Python. What would be a good metric to indicate “popularity”?

If it’s number of installs, then Python tinkerers would win and I agree with you.

Re:Julia 1.5 Highlights by eigenspace on Monday August 03, 2020 @09:46PM (#24045657)
> I’d be curious if you have data.

Sounds like a hard thing to measure, but I'm sure someone has good estimates.

> Also, if we define execution of a Python line as a metric: Instagram alone will dwarf all prototypers in Python. What would be a good metric to indicate “popularity”?

Code cycles isn't really what I would mean by language use, but if we go by that metric Julia's production code also dwarfs non-production code cycles.

The Celeste project alone was running at petaflops[1] at it's peak, that is 10^15 floating point operations per second. One of the biggest targets for Julia is deploying it at scale on super-computing clusters. There are almost surely many more CPU cycles being devoted to production scale julia code than random repl code, but that's got to be true for almost any language being used at scale.

Also, counting Python line executions in production code is a little squirreley, because almost surely those lines are really just a thin wrapper around a big hunk of C code if it's a production system.

> If it’s number of installs, then Python tinkerers would win and I agree with you.

I'd also say just number lines written or projects started, the tinkerers win hands down.

[1] https://www.hpcwire.com/off-the-wire/julia-joins-petaflop-cl...

Re:Julia 1.5 Highlights by sannee on Tuesday August 04, 2020 @09:42AM (#24049847)
Julia positions itself not as a Python alternative, but as a Matlab alternative. People also sometimes use Python as a Matlab alternative and hence would use Julia as an alternative to Python only by transitivity.