Skip to content

Super-linear compilation times if source file contains thousands of top-level LOC #72661

Open
@VAndrJ

Description

@VAndrJ

Description

Since the number of lines in a file increases, the compilation time per line of code also increases, I suggest reducing the number of lines of code in the files and breaking them into smaller ones.

Here is an example of a build with a timing summary (M1 Pro):

Screenshot 2024-03-27 at 17 31 32

it takes too much time to build some parts.

This is the result of one benchmark, showing the dependence of compilation time per line of code depending on the number of lines in the Swift file:

1711107374268

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfperformancescript modeFlag: Specific to script mode compilationunexpected behaviorBug: Unexpected behavior or incorrect output

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions