Summary: | The Julia programming language is a high performance computing language that employs an LLVM-based just-in-time compiler and an LLVM-based ahead-of-time compiler to produce optimized machine code. When Julia uses its just-in-time compiler, compilation of methods must be done before methods can begin execution, which presents as a delay the first time a function is executed. When Julia compiles code ahead of time into code images, a large fraction of time is spent optimizing and emitting machine code for large numbers of functions. Here, we investigate ways of exposing opportunities for parallelism to both compilers, as well as investigate ways to perform less work during the compilation process using newer LLVM technologies. Our results show that we can achieve speedups of 8-16X in the ahead-of-time compiler when compiling on multiple threads, while the just-in-time compiler can achieve speedups between 1.5-3X under certain circumstances. Additionally, we find that LLVM’s new CompileOnDemandLayer for delaying compilation until code is executed can avoid 30-40% of compilation work in certain applications, while LLVM’s new pass manager framework can reduce optimization time by up to 17.5% compared to the legacy pass manager. Incorporation of these compiler improvements into the Julia language yields marked decreases in the initial delays that are observed by users today.
|