Skip to content

NSIndexset isEqual performance enhancement #1605

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

Conversation

RobertPieta
Copy link

Remove expensive map and exit earlier. Should achieve performance improvement, significantly in cases where the indexSet has many intervals.

@spevans
Copy link
Contributor

spevans commented Jun 15, 2018

@swift-ci please test

@RobertPieta RobertPieta force-pushed the nsindexset_isequal_performance_enhancement branch from b4e0c6f to 01fa634 Compare June 15, 2018 23:43
@alblue
Copy link
Contributor

alblue commented Jun 26, 2018

A further optimisation would be to store the indexSet.rangeView into a constant at the start, and then use that in both places it is used in the function.

@millenomi
Copy link
Contributor

@swift-ci please test and merge

@swift-ci swift-ci merged commit 7df89db into swiftlang:master Oct 10, 2018
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.

5 participants