Julia 1.7 - Better Performance On Several Fronts
Written by Kay Ewbank   
Monday, 06 December 2021

Julia version 1.7 has been released with improvements including reproducible random number generation and new threading capabilities together with automatic package installation.

julialogo1

Until now Julia has used the popular Mersenne Twister algorithm as its default random number generator. The decision to change the generator was driven by the opportunity to get both a significant speed increase and the ability to make random number streams reproducible in multi-threaded programs.

The developers point out that Mersenne Twister is famous for having an exceptionally long period, but that requires a correspondingly large state, and is not truly necessary for any practical application. Julia also uses thread-local RNG states for thread safety, which made random streams task-schedule-dependent.

Julia now uses the Xoshiro256 family of RNGs which have a much smaller state, making it possible to put a state in every task, and fork it on each task creation. That makes random numbers depend only on the task spawning structure of a program, and not on the parallel execution schedule.

The new threading capabilities build on work in previous releases to improve the performance of programs that make heavy use of multithreading. The developers say they have addressed numerous race conditions in the runtime, chased down synchronization mistakes, refined support for scheduling workloads on multiple threads, made the default random number generator more thread-friendly, and added atomics as a primitive language feature. The support for atomic access to mutable struct fields has been added to provide more efficient build-blocks for working with threads, and has been carried out in recognition of how the team sees threading to be a key part of the language's future.

The new release also has automatic package installation.
If a package exists in a registry but is not installed, an automatic install is now offered when a package load is attempted in the REPL, so avoiding the error that used to occur. A new manifest format has also been added, overcoming problems caused by different packages requiring different Julia versions.

The developers have also improved Julia's performance for handling registries on Windows and distributed file systems. In previous releases users experienced slowness in the Julia package manager (Pkg) on Windows and on Network File Systems. The main cause of the slow down was diagnosed to be Windows Defender causing slowdowns upon closing files, so in the new release Julia comes bundled with p7zip making it possible to directly read the compressed tarball into memory without materializing any files and significantly improving the performance of the registry on Windows, NFS and other distributed file systems like those typically used in HPC systems.


This release also comes with many type inference improvements, meaning Julia 1.7 will more "smartly" infer types of your program and improve performance for free. It can now propagate type constraints that can be derived from isa and === conditions inter-procedurally, which the team says should make some programs run much faster. Another performance improvement comes courtesy of more eager constant propagation. Julia 1.7 can substitute more runtime computations with pre-computed constants.

Support has also been added for multidimensional array literals. The team says that multidimensional arrays, especially with three or more dimensions, are useful constructs for scientific programming and in machine learning, but while Julia has had first-class methods to work with multidimensional arrays, there was no way to create them with pure syntax. With Julia v1.7, the developers have added syntax to enable you to write a literal for multidimensional arrays.

julialogo1

More Information

Julia Website

Related Articles

Julia 1.5 Improves Struct Layout Support

Julia Improves Multithreading

Julia Language Creators Awarded Numerical Software Prize

Julia 0.6 Improves Type Handling

Julia Studio - An IDE For Julia

//No Comment - Ceylon 1.3 & Julia 0.5.0

Julia meets HTML5

Julia Gets $600K

Julia 0.4 Released

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Santa Is On His Way
24/12/2024

Around the world children are eagerly awaiting Santa - which is something of a problem since he'll only arrive when they are fast asleep. If you want to know when he'll arrive, track Santa's progress  [ ... ]



.NET Community Toolkit Adds Partial Properties Support For MVVM
19/12/2024

Microsoft has announced version 8.4 of the .NET Community Toolkit, a collection of helpers and APIs that work for all .NET developers. The new version adds support for partial properties for the MVVM  [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

Last Updated ( Monday, 06 December 2021 )