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

New combined data struct for IANA name mapping #4718

Merged
merged 4 commits into from
Mar 23, 2024

Conversation

sffc
Copy link
Member

@sffc sffc commented Mar 21, 2024

Split from #4548

This new data struct supports all operations, some faster than others:

  1. IANA-to-BCP47 is a fast O(1) trie lookup
  2. IANA Normalization is also a fast O(1) trie lookup
  3. BCP47-to-IANA requires an O(N) traversal over the trie
  4. IANA Canonicalization is O(1) if the ID is already canonical, and falls back to BCP47-to-IANA if not canonical

I think we should keep Bcp47ToIanaMapV1 around for users who want O(1) performance in all cases and don't mind paying the extra data size cost.

I split this from #4548 because I want to work more on the API but want to get the data provider side of my work checked-in.

@sffc sffc merged commit db791b5 into unicode-org:main Mar 23, 2024
30 checks passed
@sffc sffc deleted the iana_canon_data branch March 23, 2024 02:05
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

2 participants