Julia 1.6 is feted as next LTS release as team shows off compiler tweaks

Version 1.6 of the Julia language has been released, with the expectation that this will become the next long-term support (LTS) version. For this reason, extra time has been spent on testing and prep, in addition to the usual updates designed to tweak performance.

The final decision about whether Julia 1.6 will become the new LTS will be made after it has been “battle-tested in the field”, according to the Julia team, and this will be around the time the 1.7 release enters stabilisation. The current LTS version of Julia is version 1.0.5, released in September 2019.

Julia 1.6 includes a number of changes since version 1.5, designed to either reduce compile time or boost performance in other ways, such as faster parallel precompilation or optimisation to reduce latency. Full details can be found on the Julia project blog, while the release notes can be found on GitHub.

Parallel precompilation has been made faster in 1.6 with the addition of a heavily parallelised precompile operation that is automatically invoked after package actions, to keep the active environment ready to load. Previously, precompilation happened as a single process sequence, precompiling dependencies one by one as needed during the linear code loading process.

According to the Julia team, while the old process might take about eight minutes to precompile and load DifferentialEquations – without indicating progress while doing so – the new mechanism takes just over one minute, while showing progress through the dependencies.

Another update concerns the scheme for invalidating old code, which has been made more accurate and selective. Until now, adding new methods to previously defined functions might force Julia to recompile code to account for changes in dispatch. Earlier versions took a conservative approach, and invalidated old code in some circumstances where there was no actual change in dispatch, resulting in delays for recompilation.

In version 1.6, Julia and its standard libraries have been given “a thorough makeover” to help type inference arrive at a concrete answer more often, according to the Julia team. The result is said to be a leaner, faster Julia that is less prone to method invalidation, and feels considerably more responsive and nimble in interactive sessions.

The Julia team also tried to speed up the compiler itself, with this release securing some modest improvements thanks to work on the method table data structure. Prior to 1.6, the compiler stored methods in sorted order and also attempted to identify ambiguous methods on insertion, with the aim of avoiding a repeat for each future query. However, sort time was beginning to increase prominently during package loading, which the team has apparently improved by making the process lazier, moving sorting and ambiguity detection into the algorithm for finding matching methods.

Meanwhile, Julia 1.6 features new tools for compiler introspection, to help optimise packages for latency. Developers can use the new tools to profile type inference and determine how package implementation choices affect compilation time. According to its keepers, early adopters have been able to eliminate anything from a few percent to the large fraction of first-use latency.

The new release also features improvements to downloads and networking. In Julia 1.6, all downloading is done with libcurl-7.73.0 via the new Downloads.jl standard library, replacing a bunch of inconsistent methods seen in earlier releases. Downloading is done in-process and TCP+TLS connections are shared and reused, according to the Julia team.

Networking in Julia 1.6 now uses the built-in TLS stack on Macs and Windows, which allows downloads to use the operating system’s built-in mechanism for verifying the identity of TLS servers via certificate authority root certificates. This makes it much more likely that Julia will “just work” from behind firewalls, according to the team.