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

[SR-5093] Reduce time needed to compile this snippet containing Array of Array #47669

Closed
jepers opened this issue Jun 6, 2017 · 0 comments
Closed
Labels
compiler The Swift compiler in itself improvement performance type checker Area → compiler: Semantic analysis

Comments

@jepers
Copy link

jepers commented Jun 6, 2017

Previous ID SR-5093
Radar None
Original Reporter @jepers
Type Improvement
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, Performance, TypeChecker
Assignee None
Priority Medium

md5: e8b99935eb1e60a22076965033e72273

Issue Description:

Tested with Xcode 8.3 default toolchain (Swift 3.1) and also dev snapshot 2017-06-02 (Swift 4), both are exceptionally slow at compiling this program (8 seconds on my MBP):

var maa = [[Int]]()
let i = 1
let j = 2
#if HELPING_TYPE_CHECKER
    let a = maa[i + 1][j - 1]
    let b = maa[i - 1][j + 1]
    maa[i][j] = a + b
#else
    maa[i][j] = maa[i + 1][j - 1] + maa[i - 1][j + 1]
#endif

$ time swiftc -D HELPING_TYPE_CHECKER test.swift
real    0m0.151s
user    0m0.114s
sys 0m0.024s

$ time swiftc test.swift
real    0m8.595s
user    0m8.277s
sys 0m0.302s
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself improvement performance type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

1 participant