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-10253] Type checker takes a very long time for tuple array #52653

Open
tkrajacic opened this issue Apr 1, 2019 · 1 comment
Open

[SR-10253] Type checker takes a very long time for tuple array #52653

tkrajacic opened this issue Apr 1, 2019 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself performance type checker Area → compiler: Semantic analysis

Comments

@tkrajacic
Copy link

Previous ID SR-10253
Radar None
Original Reporter @tkrajacic
Type Bug

Attachment: Download

Environment

Xcode 10.2, macOS 10.14.4 (18E226), Swift 5

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Performance, TypeChecker
Assignee None
Priority Medium

md5: 837d8a515bbce96883d9d71a5c26b581

Issue Description:

This code takes between 15 and 25❗ seconds to type-check in the production app.

lazy var data: [(timespan: TimeInterval, caption: String)] = {
        
    return [
            (timespan: 0, caption: L10n.atDueDate),
            (timespan: 5 * kMinute, caption: L10n.xMinutesBefore(5)),
            (timespan: 15 * kMinute, caption: L10n.xMinutesBefore(15)),
            (timespan: 30 * kMinute, caption: L10n.xMinutesBefore(30)),
            (timespan: kHour, caption: L10n.oneHourBefore),
            (timespan: 2 * kHour, caption: L10n.xHoursBefore(2)),
            (timespan: kDay, caption: L10n.oneDayBefore),
            (timespan: 2 * kDay, caption: L10n.xDaysBefore(2)),
            (timespan: 7 * kDay, caption: L10n.oneWeekBefore),
    ]
}()

A simplified test-project is attached.

Of course it is easy to mitigate by just using a simple struct.

@belkadan
Copy link
Contributor

belkadan commented Apr 1, 2019

cc @xedin

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself performance type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants