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-13375] Performance regression on master: swift_COWSanityChecksEnabled #55815

Open
fabianfett opened this issue Aug 10, 2020 · 3 comments
Open
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@fabianfett
Copy link
Member

Previous ID SR-13375
Radar None
Original Reporter @fabianfett
Type Bug
Environment

```
Docker: swift:nightly-bionic (ImageId: 6adf11873420)
Swift version 5.3-dev (LLVM 03a20a7, Swift f9e54e1)
Target: x86_64-unknown-linux-gnu

Docker: swift:nightly-5.3-bionic (ImageId: 702e3f647de8)
Swift version 5.3-dev (LLVM 8cbcb68, Swift fc45397)
Target: x86_64-unknown-linux-gnu
```

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

md5: babde2cb25f7247cf438f2a66d96c9a7

cloned to:

  • SR-13379 stdlib-asserts Performance regression from swift_COWSanityChecksEnabled

Issue Description:

Hi, I can see a performance regression between master and the 5.3 branch. I noticed the difference when I ran some tests for my base64 library (The implementation is not complex and the only dependency is the Standard Library).

https://github.com/fabianfett/swift-base64-kit

Code:

https://github.com/fabianfett/swift-base64-kit/blob/35d3358a867e954f8f87769df3f9ae2eb6d9da14/Sources/Base64Kit/Base64.swift#L149

For the tests I used the Docker images from tonight:

```
Docker: swift:nightly-bionic (ImageId: 6adf11873420)

Swift version 5.3-dev (LLVM 03a20a7, Swift f9e54e1)
Target: x86_64-unknown-linux-gnu

Docker: swift:nightly-5.3-bionic (ImageId: 702e3f647de8)

Swift version 5.3-dev (LLVM 8cbcb68, Swift fc45397)
Target: x86_64-unknown-linux-gnu
```

I ran the tests (`swift run -c release`) with the two image above on my main branch:

master:
```
Number of invocations: 1000000

Encoding
Foundation | took: 0.5717020034790039s
Base64 | took: 39.250354051589966s

Decoding
Foundation | took: 1.2178590297698975s
Base64 | took: 26.803733944892883s

```

5.3-branch:
```

Encoding
Foundation | took: 1.552825927734375s
Base64 | took: 0.8509190082550049s

Decoding
Foundation | took: 5.576089024543762s
Base64 | took: 0.9508119821548462s

```

While the Foundation implementation has gotten significantly faster �, something must have change under the hood that makes my implementation a lot slower. I wanted to look into it with Instruments.app, but sadly I couldn't install the toolchain from master (using the swift.org download).

I hope that helps, if you have any questions, please reach out.

@atrick
Copy link
Member

atrick commented Aug 10, 2020

The linux build needs to be fixed to not enable stdlib asserts. However, I suggest you leave this bug open, or file a new one, for @eeckstein to fix the stdlib-asserts performance problem.

@theblixguy
Copy link
Collaborator

This should be fixed by #33393

@atrick
Copy link
Member

atrick commented Aug 10, 2020

I went ahead and filed new bug for the stdlib-asserts performance problem:

https://bugs.swift.org/browse/SR-13379

so you can just close this one when the build preset is changed.

@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. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants