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 Windows CFTimeZone identifier lookups could be more efficient #5073

Open
jmschonfeld opened this issue Aug 16, 2024 · 0 comments
Open

New Windows CFTimeZone identifier lookups could be more efficient #5073

jmschonfeld opened this issue Aug 16, 2024 · 0 comments

Comments

@jmschonfeld
Copy link
Contributor

In #5070 I restored the Windows behavior for converting between Windows and Olson timezone identifiers. This conversion currently performs a linear search through a list of identifiers to find a matching pair and return the result. We could be more efficient here by pre-sorting the list and performing a binary search or sorting based on a pre-computed hash to mimic a constant-dictionary for constant time lookup.

https://github.com/apple/swift-corelibs-foundation/blob/e0f1615328571f9a27d4bb55efb0e1e57e2ea941/Sources/CoreFoundation/CFTimeZone_WindowsMapping.c#L529-L542

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

No branches or pull requests

1 participant