Resolves issue #5123 "Charts framework takes a long time to build" (https://github.com/danielgindi/Charts/issues/5123) by implementing the recommendations listed at the end of the issue. These changes improved the clean full Debug build time by 30%.
Improves build times of the Charts framework target for both clean and incremental Debug builds, enabling more parallelization during building.
Implementation Details :construction:
This PR makes the following changes:
Sets Eager Linking build setting to Yes for Charts framework target
Sets Enable Module Verifier build setting to No for Debug builds
Sets Compilation Mode to Incremental for Debug builds
Added -Xfrontend -warn-long-expression-type-checking=50 (or perhaps use 100) to OTHER_SWIFT_FLAGS so the Swift compiler will emit warnings for expressions that take a long time to type-check. The number after the = is the number of milliseconds threshold, above which warnings will be emitted.
Refactored the slow type-checking hotspots identified above in ChartAnimationEasing.swift, breaking out expressions which are slow to type-check into separate, quicker-to-type-check expressions.
Testing Details :mag:
To test/verify the build time improvement, use these simple steps -- first with the existing code, and then again using this PR branch/commit:
Resolves issue #5123 "Charts framework takes a long time to build" (https://github.com/danielgindi/Charts/issues/5123) by implementing the recommendations listed at the end of the issue. These changes improved the clean full
Debug
build time by 30%.Issue Link :link:
Charts framework takes a long time to build
Goals :soccer:
Improves build times of the Charts framework target for both clean and incremental
Debug
builds, enabling more parallelization during building.Implementation Details :construction:
This PR makes the following changes:
Eager Linking
build setting toYes
forCharts
framework targetEnable Module Verifier
build setting toNo
forDebug
buildsCompilation Mode
toIncremental
forDebug
builds-Xfrontend -warn-long-expression-type-checking=50
(or perhaps use100
) toOTHER_SWIFT_FLAGS
so the Swift compiler will emit warnings for expressions that take a long time to type-check. The number after the = is the number of milliseconds threshold, above which warnings will be emitted.ChartAnimationEasing.swift
, breaking out expressions which are slow to type-check into separate, quicker-to-type-check expressions.Testing Details :mag:
To test/verify the build time improvement, use these simple steps -- first with the existing code, and then again using this PR branch/commit:
rm -rf $HOME/Library/Developer/Xcode/DerivedData
)