Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improves build time by 30%, resolving issue 5123 "Charts Framework takes a long time to build" #5124

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

drewster99
Copy link

@drewster99 drewster99 commented Nov 8, 2023

Resolves issue #5123 "Charts framework takes a long time to build" (#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 🔗

Charts framework takes a long time to build

Goals ⚽

Improves build times of the Charts framework target for both clean and incremental Debug builds, enabling more parallelization during building.

Implementation Details 🚧

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 🔍

To test/verify the build time improvement, use these simple steps -- first with the existing code, and then again using this PR branch/commit:

  • Quit Xcode
  • Delete DerivedData (rm -rf $HOME/Library/Developer/Xcode/DerivedData)
  • Open Xcode
  • Open Charts.xcworkspace
  • Hit Command-B to make a debug build
  • Look at the total time at the end of your build log

Resolves issue ChartsOrg#5123 "Charts framework takes a long time to build" (ChartsOrg#5123) by implementing the recommendations listed at the end of the issue:
- Set `Eager Linking` build setting to `Yes` for `Charts` framework target
- Set `Enable Module Verifier` build setting to `No` for `Debug` builds
- Set `Compilation Mode` to `Incremental` for `Debug` builds
- Add `-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.
@drewster99 drewster99 changed the title Improves clean Debug build time by about 30%. Improves build time by 30%, resolving issue 5123 "Charts Framework takes a long time to build" Nov 8, 2023
@pmairoldi pmairoldi self-assigned this Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants