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-12062] Swift compiler slow when SignedNumeric is used inside closure #54498

Open
swift-ci opened this issue Jan 21, 2020 · 1 comment
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself performance

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-12062
Radar rdar://problem/58997099
Original Reporter ipos (JIRA User)
Type Bug

Attachment: Download

Environment

Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)

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

md5: 32fc33dd059780912b48deddad38dff8

Issue Description:

Swift compiler is considerably slow when SignedNumeric is used inside closure (might be because of overflow handling?).

Following simple code is taking about 70ms on my machine:

func test() {
    { //70ms here with OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-expression-type-checking"
        let x: Int = 100
        -x
    }()
}

By removing the negation operator ('-') drops to mere ~1.6ms

AST and SIL after SILGen are attached just in case

@beccadax
Copy link
Contributor

@swift-ci create

@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
Projects
None yet
Development

No branches or pull requests

3 participants