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

joining a lazy map of Strings is super-slow #62258

Open
dabrahams opened this issue Nov 26, 2022 · 1 comment
Open

joining a lazy map of Strings is super-slow #62258

dabrahams opened this issue Nov 26, 2022 · 1 comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. performance standard library Area: Standard library umbrella

Comments

@dabrahams
Copy link
Contributor

Description
This godbolt shows that performance goes off a cliff when we join a lazy map of Strings.

Environment

  • Swift 5.7
@dabrahams dabrahams added bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. performance standard library Area: Standard library umbrella SILOptimizer Area → compiler: SIL optimization passes labels Nov 26, 2022
@dabrahams
Copy link
Contributor Author

dabrahams commented Nov 26, 2022

And this godbolt demonstrates that most of the slowdown is due to the supposed optimization the library makes of assuming all the strings to be joined have length 1. Perhaps what is chosen for benchmarking could use some attention.

@AnthonyLatsis AnthonyLatsis added compiler The Swift compiler itself and removed compiler The Swift compiler itself labels Nov 26, 2022
@dabrahams dabrahams removed the SILOptimizer Area → compiler: SIL optimization passes label Nov 26, 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. performance standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants