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

Deprecate isAsciiString and replace its internal usages #1451

Merged
merged 1 commit into from
Mar 24, 2021

Conversation

tkountis
Copy link
Contributor

@tkountis tkountis commented Mar 23, 2021

Motivation:
Minimize exposed CharSequences API and don't expose internal detail.

Modifications:
Deprecate isAsciiString and replace it's usages.

Result:
Cleaner API.


Also attempted a solution with an IndexOfExtractor interface exposed directly from CharSequences and bench marked the two. The benefit was negligible (assuming that the JIT optimized for that particular case ie. CharSequence) so I chose to keep simple.

For reference:

CharSequencesBenchmark.isValidIpV4Address     thrpt    5  37734929.772 ±  935310.988  ops/s
CharSequencesBenchmark.isValidIpV4AddressNew  thrpt    5  38000362.771 ± 2153374.472  ops/s

* isValidIpV4AddressNew is with the IndexOfExtractor approach

@tkountis tkountis self-assigned this Mar 23, 2021
@tkountis tkountis merged commit dab5c28 into apple:main Mar 24, 2021
@tkountis tkountis deleted the enh/deprecate-isAsciiStr branch March 24, 2021 16:29
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.

2 participants