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

[Python] Unicode partitioning has poor time complexity #165

Closed
lucasmcdonald3 opened this issue Jan 10, 2025 · 1 comment
Closed

[Python] Unicode partitioning has poor time complexity #165

lucasmcdonald3 opened this issue Jan 10, 2025 · 1 comment

Comments

@lucasmcdonald3
Copy link

Unicode partitioning code: https://github.com/dafny-lang/libraries/blob/master/src/Unicode/UnicodeEncodingForm.dfy#L123-L128

The Dafny Python runtime implements "get subsequence" in O(k), where k is the length of the subsequence. (code)
The Unicode partitioning code hopes that "get subsequence" is O(1) for reasonable performance in a runtime.
The linked code runs very slowly as as result of the slow implementation.
This creates challenges when I'm working with large JSON files using the Dafny JSON tools.

@lucasmcdonald3
Copy link
Author

This would be addressed by dafny-lang/dafny#2313

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

No branches or pull requests

1 participant