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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the comparison with the bundle id #275

Merged
merged 2 commits into from May 7, 2021

Conversation

tattn
Copy link
Contributor

@tattn tattn commented Jan 20, 2021

This is a change to improve the speed of user agent generation.

  • Objective-C does not crash if the receiver is nil, and returns false, so nil checking can be reduced.
  • Forward matching is faster for string comparisons. The bundle ID string of the mapbox SDK starts with com.mapbox.

If there is a problem with the implementation, let me know. 馃槂

@tsuz tsuz requested review from rclee and alfwatt January 21, 2021 05:47
@tattn
Copy link
Contributor Author

tattn commented Jan 21, 2021

As a result of measuring with Time Profiler, the user-agent generation is about 10% faster for our apps.

Copy link
Contributor

@alfwatt alfwatt left a comment

Choose a reason for hiding this comment

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

Looks good, the Null check might have been slightly faster but it's rare to get a null in that set

@tattn
Copy link
Contributor Author

tattn commented Mar 9, 2021

@rclee How about this PR? If it's OK, please merge it. 馃槃

@YoshiYazawa
Copy link

@alfwatt has this update been merged?

@vayesh
Copy link
Contributor

vayesh commented May 6, 2021

@tattn LGTM. Could you rebase it on main and merge?

@tattn
Copy link
Contributor Author

tattn commented May 6, 2021

@vesh93 Thank you for your review! It's done 馃憤

@vayesh vayesh merged commit 6562fdc into mapbox:main May 7, 2021
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