# Will Julia ever fix its "using ..." latency problems?

**URL:** <https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659>\
**Category:** Performance\
**Created:** [November 23, 2020, 11:57pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659 "2020-11-23T23:57:55Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![stillyslalom](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stillyslalom/32/45687_2.png) [@stillyslalom](https://discourse.julialang.org/u/stillyslalom)\
**Post date:** [November 24, 2020, 6:56pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/45 "2020-11-24T18:56:34Z")

</div>

When I’m in the early phase of development that requires frequently redefining structs, I like to swap in `NamedTuple`s. You can’t use Julia’s dispatch system, but they behave enough like structs to allow for drop-in replacement in most simple cases (concretely-typed fields, dot syntax for field access).

---

<div class="post-metadata">

**Author:** ![Volker\_Weissmann](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@Volker\_Weissmann](https://discourse.julialang.org/u/Volker_Weissmann)\
**Post date:** [November 24, 2020, 7:07pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/51 "2020-11-24T19:07:12Z")

</div>

It would be nice if Julia would mention its using … performance disadvantage on their website. I hate it when open source software promises alot more than it delivers.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [November 24, 2020, 7:11pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/53 "2020-11-24T19:11:15Z")

</div>

> [@Volker\_Weissmann](#):
>
> I hate it when open source software promises alot more than it delivers.

Well, that is just rude with the developers. First, because it is a matter of priorities. I never felt that so badly as you. Second, because NO software, nor anything else, starts showing up what can be its possible disadvantages relative to every other alternative.

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [November 24, 2020, 7:28pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/55 "2020-11-24T19:28:40Z")

</div>

> [@Volker\_Weissmann](#):
>
> It would be nice if Julia would mention its using … performance disadvantage on their website. I hate it when open source software promises alot more than it delivers

You mean how the Python webpage warns you of a two order of magnitude performance disadvantage to writing a for loop?

---

<div class="post-metadata">

**Author:** ![Volker\_Weissmann](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@Volker\_Weissmann](https://discourse.julialang.org/u/Volker_Weissmann)\
**Post date:** [November 24, 2020, 8:09pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/59 "2020-11-24T20:09:31Z")

</div>

> [@lmiq](#):
>
> Well, that is just rude with the developers.

No it is not.  
Remember that I did not criticized Julia for having disadvantages, but I criticized them for not advertising their disadvantages.

> [@lmiq](#):
>
> First, because it is a matter of priorities. I never felt that so badly as you.

I don’t know what you mean.

> [@lmiq](#):
>
> Second, because NO software, nor anything else, starts showing up what can be its possible disadvantages relative to every other alternative.

Every software damn well should.  
Very few software does it (the only example I just found is [meson](https://mesonbuild.com/Comparisons.html) ).

Just because everyone fails to do this does not mean that it is right to not do it.

---

<div class="post-metadata">

**Author:** ![Volker\_Weissmann](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@Volker\_Weissmann](https://discourse.julialang.org/u/Volker_Weissmann)\
**Post date:** [November 24, 2020, 8:13pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/60 "2020-11-24T20:13:20Z")

</div>

> [@baggepinnen](#):
>
> You mean how the Python webpage warns you of a two order of magnitude performance disadvantage to writing a for loop?

They don’t but I think they damn well should.

\<sarcasm\>

But Python is fast! Look at this benchmark where I call numpy (a C library) and its fast! No other language has the feature of calling C libraries!

\</sarcasm\>

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [November 24, 2020, 8:17pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/61 "2020-11-24T20:17:08Z")

</div>

> [@Volker\_Weissmann](#):
>
> I don’t know what you mean.

I meant that I do not think that is a disadvantage that is worth mentioning at the top Julia page. For me it was never an issue. There are other things in Julia that I like least than that, and I do not think that they should be put in the top pages either. Also, it is written in the docs, explained, discussed, and people are working on it.

It is written here: [Modules · The Julia Language](https://docs.julialang.org/en/v1/manual/modules/#Module-initialization-and-precompilation)

There is also a dedicated page to the differences between Julia and other languages, where every field can be considered an advantage or disadvantage, depending on the user: [Noteworthy Differences from other Languages · The Julia Language](https://docs.julialang.org/en/v1/manual/noteworthy-differences/)

---

<div class="post-metadata">

**Author:** ![mcreel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mcreel/32/30088_2.png) [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Post date:** [November 24, 2020, 8:21pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/62 "2020-11-24T20:21:57Z")

</div>

[julialang.org](http://julialang.org) has

### Fast

Julia was designed from the beginning for [high performance](https://julialang.org/benchmarks/). Julia programs compile to efficient native code for [multiple platforms](https://julialang.org/downloads/#support_tiers) via LLVM.

prominently displayed, so it’s clear that compilation is needed. This “time to first plot” discussion has been around forever, it’s hardly a hidden pitfall of Julia.

---

<div class="post-metadata">

**Author:** ![Volker\_Weissmann](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@Volker\_Weissmann](https://discourse.julialang.org/u/Volker_Weissmann)\
**Post date:** [November 24, 2020, 8:26pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/63 "2020-11-24T20:26:48Z")

</div>

Maybe here  
[https://docs.julialang.org/en/v1/manual/noteworthy-differences/](https://docs.julialang.org/en/v1/manual/noteworthy-differences/)  
should be a a note about julias using… performance.

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [November 24, 2020, 8:36pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/65 "2020-11-24T20:36:23Z")

</div>

> [@Volker\_Weissmann](#):
>
> Maybe here

You can propose the addition there directly as a pull request, wherever you think that is important. At the end, it is free open source software.

---

<div class="post-metadata">

**Author:** ![zgornel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zgornel/32/217487_2.png) [@zgornel](https://discourse.julialang.org/u/zgornel)\
**Post date:** [November 24, 2020, 8:53pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/66 "2020-11-24T20:53:56Z")

</div>

This is actually a quite ellegant solution for long and complex interactive prototyping sessions

---

<div class="post-metadata">

**Author:** ![Sukera](https://avatars.discourse-cdn.com/v4/letter/s/ce7236/32.png) [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Post date:** [November 24, 2020, 9:11pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/67 "2020-11-24T21:11:03Z")

</div>

> [@Volker\_Weissmann](#):
>
> should be a a note about julias using… performance.

May I ask how long you’ve been around with julia? I certainly remember the days of 0.6, where e.g. `using Plots` took tens of minutes on the very machine I’m typing on now.

Also, there have been multiple links in this thread (and in the linked issues and other things) pointing towards improving that state even more. As a short recap what has happened in the past few months:

- Deep investigations what made compilation slower than necessary
- How to remove those unnecessary slow spots
- Build better package serving infrastructure (PkgServer serving tarballs instead of downloading git repositories from GitHub…)
- Figure out why some packages and code patterns took a long time to compile and fix those code paths in the compiler
- Make the compiler itself faster
- Investigate issues why certain packages increase load time dramatically
- Fix those packages (this is the recent “crusade on invalidations”, where package code and functions have to be recompiled because a newly loaded packages caused a lot of already cached and compiled functions to have to be recompiled)

Some future work includes:

- Cache not only lowered & typed code, but also native, compiled machine code
- Cache more code between environments
- Cache more code
- Reduce compiler latency
- maybe even serve compiled code?
- Did I mention cache more code, even compiled code?

> [@Redefining structs without restart?](https://discourse.julialang.org/t/redefining-structs-without-restart/50826/16):
>
> Would this problem still exist if there would be no `eval` and `@eval` command?  
> (I’m not proposing to remove these commands, I just want to understand how Julia works.)

I’m only 95% sure that nothing similar would crop up, but yes, these specific problems are gone insofar you can’t express that idea at all anymore.

Without `eval` and `@eval`, there is no REPL and there is no interactive mode. There’s also no recompilation at runtime and there’s no shadowing of existing things in the same namespace since there’s no way to “redefine” anything like a struct or a function at runtime. There’s also no convenient creating of similar function expressions and writing boilerplate (where you define functions with different names but that can take the same arguments) would be a dread. Julia would just be another statically compiled language like C, C++ or Rust (or any number of other compiled languages).

It certainly wouldn’t be the end of the world and most of the time when people want to use `eval`, they really shouldn’t anyway (don’t parse & eval strings to emulate bad macros!). Their existence does make certain things much easier and provides a lot of flexibility though, so I’m really glad we have them. You also learn a lot about why it’s a bad idea to allow redefining everything at any time, so being limited to certain places makes the language much more powerful & performant as a whole.

Always remember, the really fast parts in Python are not written in Python 🙂

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [November 24, 2020, 9:20pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/68 "2020-11-24T21:20:36Z")

</div>

The search and replace trick to update structs works just fine with modules. I usually go for weeks (working everyday) without restarting my sessions, and I’m not even using Revise (I usually reload manually using `@eval MyModule include("myfile")`).

---

<div class="post-metadata">

**Author:** ![Volker\_Weissmann](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@Volker\_Weissmann](https://discourse.julialang.org/u/Volker_Weissmann)\
**Post date:** [November 24, 2020, 9:58pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/69 "2020-11-24T21:58:00Z")

</div>

> [@Sukera](#):
>
> May I ask how long you’ve been around with julia? I certainly remember the days of 0.6, where e.g. `using Plots` took tens of minutes on the very machine I’m typing on now.

Only since about a month. In my bachelor thesis of physics, I wrote rust and python and for my master thesis of physics, I’m hoping to replace both of them with Julia (at least for scientific computing).

> [@Sukera](#):
>
> Also, there have been multiple links in this thread (and in the linked issues and other things) pointing towards improving that state even more. As a short recap what has happened in the past few months:  
> …

I’m happy to see that Julia is very actively developed.

> [@Redefining structs without restart?](https://discourse.julialang.org/t/redefining-structs-without-restart/50826/16):
>
> > [@Redefining structs without restart?](https://discourse.julialang.org/t/redefining-structs-without-restart/50826/16):
> >
> > Would this problem still exist if there would be no `eval` and `@eval` command?
> > 
> > > (I’m not proposing to remove these commands, I just want to understand how Julia works.)
> 
> I’m only 95% sure that nothing similar would crop up, but yes, these specific problems are gone insofar you can’t express that idea at all anymore.
> 
> Without `eval` and `@eval` , there is no REPL and there is no interactive mode. There’s also no recompilation at runtime and there’s no shadowing of existing things in the same namespace since there’s no way to “redefine” anything like a struct or a function at runtime. There’s also no convenient creating of similar function expressions and writing boilerplate (where you define functions with different names but that can take the same arguments) would be a dread. Julia would just be another statically compiled language like C, C++ or Rust (or any number of other compiled languages).

Thank you for your explanation.

> [@Sukera](#):
>
> Always remember, the really fast parts in Python are not written in Python

Of course.

---

<div class="post-metadata">

**Author:** ![Volker\_Weissmann](https://avatars.discourse-cdn.com/v4/letter/v/c2a13f/32.png) [@Volker\_Weissmann](https://discourse.julialang.org/u/Volker_Weissmann)\
**Post date:** [November 24, 2020, 10:28pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/71 "2020-11-24T22:28:24Z")

</div>

See [https://github.com/JuliaLang/julia/pull/38572](https://github.com/JuliaLang/julia/pull/38572)

---

<div class="post-metadata">

**Author:** ![brett\_knoss](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/brett_knoss/32/13050_2.png) [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Post date:** [November 25, 2020, 1:56am UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/73 "2020-11-25T01:56:00Z")

</div>

I figured that’s why JS is so common, I’d think Go or Elixer would be good for front end, maybe Chrystal one day.

---

<div class="post-metadata">

**Author:** ![isaacsas](https://avatars.discourse-cdn.com/v4/letter/i/f6c823/32.png) [@isaacsas](https://discourse.julialang.org/u/isaacsas)\
**Post date:** [November 25, 2020, 2:35am UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/74 "2020-11-25T02:35:33Z")

</div>

On `using DifferentialEquations` being slow; I recommend just not pulling in all the DifferentialEquations.jl packages in this way. I regularly use ODE/SDE/jump solvers, but never load the full meta package. I really think that at this point the meta package should only be used for simplifying tutorials aimed at beginners. For solving ODEs usually just

```julia
using DiffEqBase, OrdinaryDiffEq

```

is sufficient to load everything one needs. For SDEs you’ll also load `StochasticDiffEq`, etc. If you just load the set of component packages you need you’ll find a much reduced import time.

---

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [November 25, 2020, 8:53am UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/75 "2020-11-25T08:53:21Z")

</div>

> [@Volker\_Weissmann](#):
>
> It would be nice if Julia would mention its using … performance disadvantage on their website. I hate it when open source software promises alot more than it delivers.

You can find [all open performance issues](https://github.com/JuliaLang/julia/issues?q=is%3Aopen+is%3Aissue+label%3Aperformance) on Github. Listing these on the julialang website would be redundant and overwhelming — that’s not the place for them.

While it is work in progress like all modern programming languages, a lot of people are using Julia productively. Instead of complaining about it being [“nearly unusable”](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-performance-problems/50659), I would recommend that you just invest into learning the workflow that fits the language.

---

<div class="post-metadata">

**Author:** ![ctkelley](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ctkelley/32/10684_2.png) [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Post date:** [November 25, 2020, 11:39pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/83 "2020-11-25T23:39:00Z")

</div>

> [@josePereiro](#):
>
> Check [jupytext](https://github.com/mwouts/jupytext), you can use a .jl file as a notebook. That is super usefull for version control too.

Does jupytext work within IJulia or is it a different deal entirely?

---

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [November 25, 2020, 11:40pm UTC](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659/84 "2020-11-25T23:40:52Z")

</div>

> [@Redefining structs without restart?](https://discourse.julialang.org/t/redefining-structs-without-restart/50826/15):
>
> Julia is a compiled language, not interpreted.

Note:

```julia
$ julia --help-hidden
julia [switches] -- [programfile] [args...]
 --compile={yes|no|all|min}Enable or disable JIT compiler, or request exhaustive compilation

```

I call `julia -O0 -compile=min` the “Python”-option. It’s some minimal compilation (and yes, Python has compilation too; its is minimal, to bytecode). Feel free to try, -compile=no while that’s going to far, you immediately get all kinds of strangeness.

So officially documented is “no” compilation, as an option, implying interpretation.

> [@Volker\_Weissmann](#):
>
> I did not criticize Julia for having disadvantages, but I criticized them for not advertising their disadvantages.

I can see your point, while you put them to a very high standard, higher than I guess any proprietary software and most open source.

Before we put in a disadvantages section, it’s good to know what’s already there to fix startup-slowness, or at least link to the (partial, for now) solution.

[Previous page](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659.md?page=2)

[Next page](https://discourse.julialang.org/t/will-julia-ever-fix-its-using-latency-problems/50659.md?page=4)
