Skip to content

Swift package compile times are 10-20 times worse on Windows than on Linux #7943

@silverhammermba

Description

@silverhammermba

Description

Building the exact same Swift package on the same computer but using Windows takes orders of magnitude longer for both clean and incremental builds than doing it on Linux.

Reproduction

I've been trying to build this Swift package: https://github.com/migueldeicaza/SwiftGodot/. For future reference, I'm building tag 0.40.0

I reported this issue to the maintainer of that package and he insists the slowdown is purely up to the Swift compiler to fix: migueldeicaza/SwiftGodot#299 (comment)

Expected behavior

The above package build on Linux takes 83 seconds for a clean build and 3 seconds for an incremental build (after making trivial changes).

In Windows 10 it takes 19 minutes for a clean build and 13 minutes for an incremental build. This makes the package all but unusable on Windows. Comparing the incremental builds (which are the most important, in my opinion), that's over 240 times slower than on Linux.

Environment

Swift version 5.9.2 (swift-5.9.2-RELEASE)
Target: x86_64-unknown-windows-msvc

Additional information

I'm up for profiling this to figure out exactly where the slowdown is but I don't know where to get started with that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance optimizations and improvementsswift 5.10This PR targets the 5.10 branchwindows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions