Skip to content

Compile times of large generated functions #60157

@AntonReinhard

Description

@AntonReinhard

One of the things Julia (deservedly) prides itself on is how dynamic it is and how well it understands its own code, i.e., meta-programming. This works great, but has a soft-limitation, because compile times get totally out of hand.

I'm generating some large functions and have collected a few data points (on 1.12.1, the top-level function's body is marked @noinline):

Image

I understand that compilation is a hard problem and scales non-linearly considering many necessary optimizations. However, other languages (Fortran, C/C++, ...) can handle much larger codes and functions than this. The largest function in the plot above is ~37k lines long and takes about 5 minutes to compile. The next larger problem size (which would definitely still be relevant to me) would be about 160k lines long and I have not been able to compile this yet at all, even after hours of waiting.

Why is this such a problem for Julia? Is there any effort to tackle this issue? I know there has been lots of work on precompilation and making larger/complex packages like the plotting libraries compile faster, but this seems like a different topic.

I'd be glad to provide test results or performance profiling if that helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:codegenGeneration of LLVM IR and native codecompiler:llvmFor issues that relate to LLVMperformanceMust go faster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions