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

Fix SR-15785 by adding a cached reference to the last linked list node, avoiding n^2 append scaling #41165

Merged
merged 2 commits into from
Feb 3, 2022

Conversation

Catfish-Man
Copy link
Contributor

@Catfish-Man Catfish-Man commented Feb 2, 2022

Speeds up a trivial benchmark with 50,000 appends from 10+ seconds in a release build, to 0.2 seconds in a debug build, on my machine.

Fixes rdar://88219931

@Catfish-Man Catfish-Man self-assigned this Feb 2, 2022
Copy link
Contributor

@ktoso ktoso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, LGTM 👍

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test and merge

@ogres
Copy link
Contributor

ogres commented Feb 2, 2022

it would be nice, if we could also add a benchmark to ensure that we do not regress in future

@Catfish-Man
Copy link
Contributor Author

Yes, I'm working on that currently. Using Concurrency stuff in the benchmarks is slightly non-obvious for now.

@Catfish-Man
Copy link
Contributor Author

Turns out "slightly non-obvious" is actually more like extremely non-obvious, adding a regression test will have to wait a bit, sorry.

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants