Skip to content

Reduce compile time for large strongly connected call graphs. #21779

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

Merged
merged 1 commit into from
Jan 11, 2019
Merged

Reduce compile time for large strongly connected call graphs. #21779

merged 1 commit into from
Jan 11, 2019

Conversation

atrick
Copy link
Contributor

@atrick atrick commented Jan 11, 2019

Improves SwiftSyntax release build speed by 4x.

Limit the size of the sets tracked by inter procedural
AccessedStorageAnalysis. There is a lot of leeway in this limit since
"normal" code doesn't come close to hitting it and SwiftSyntax compile
time isn't noticeably affected until 10x this limit.

This change also avoids reanalyzing function bodies once results have
bottomed out and avoids copying sets in the common case.

Fixes rdar://problem/46905624 Release build time regression, a lot of time spent on AccessEnforcementOpts::run().

This is just a band aid. The fundamental problem is really:
rdar://problem/47195282 Recomputing BottomUpIPAnalysis takes most of
the SwiftSyntax compile time.

SwiftSyntax compile time is still at least an order of magnitude
longer than it should be.

Improves SwiftSyntax release build speed by 4x.

Limit the size of the sets tracked by inter procedural
AccessedStorageAnalysis. There is a lot of leeway in this limit since
"normal" code doesn't come close to hitting it and SwiftSyntax compile
time isn't noticeably affected until 10x this limit.

This change also avoids reanalyzing function bodies once results have
bottomed out and avoids copying sets in the common case.

Fixes <rdar://problem/46905624> Release build time regression, a lot of time spent on AccessEnforcementOpts::run().

This is just a band aid. The fundamental problem is really:
<rdar://problem/47195282> Recomputing BottomUpIPAnalysis takes most of
the SwiftSyntax compile time.

SwiftSyntax compile time is still at least an order of magnitude
longer than it should be.
@atrick
Copy link
Contributor Author

atrick commented Jan 11, 2019

@swift-ci test.

@atrick
Copy link
Contributor Author

atrick commented Jan 11, 2019

@swift-ci benchmark.

@atrick
Copy link
Contributor Author

atrick commented Jan 11, 2019

@swift-ci test source compatibility.

@atrick atrick requested review from eeckstein and shajrawi January 11, 2019 00:54
@swift-ci
Copy link
Contributor

Build comment file:

Performance: -Onone

TEST OLD NEW DELTA RATIO
Regression
ObjectiveCBridgeStubToNSDate2 1074 1343 +25.0% 0.80x (?)
TypeFlood 200 217 +8.5% 0.92x (?)
Improvement
DataAppendDataLargeToLarge 51400 37400 -27.2% 1.37x (?)
How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB
--------------

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 5b42469

Copy link

@shajrawi shajrawi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - I see Linux failed with a segfault in Foundation but I assume that's unrelated?

@atrick
Copy link
Contributor Author

atrick commented Jan 11, 2019

@swift-ci test linux platform.

@atrick atrick merged commit 54cff6d into swiftlang:master Jan 11, 2019
@atrick atrick deleted the fix-merge-access branch February 22, 2019 17:24
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.

4 participants