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. 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. 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.
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. More InformationRelated ArticlesJulia 1.5 Improves Struct Layout Support 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
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.
Comments
or email your comment to: comments@i-programmer.info |
Last Updated ( Monday, 06 December 2021 ) |