DRAFT: libwcwidth portable C11 library - #233
Draft
jquast wants to merge 13 commits into
Draft
Conversation
Port width/wcswidth/wcstwidth, wrap, clip, escape, and SGR to C11 (libwcwidth) with utf8 or codepoints/u32 API's, and and codepoints/u32 terminal override support. Note that for the higher level functions, the u32 variants are slow -- they convert to utf8 then back to u32, and so the utf8 functions are preferred. Exposed the C11 library as an optional CPython extension, which should drastically improve python wcwidth performance, though the real aim was to use the existing python tests and frameworks (ucs-detect) to exercise and verify the C11 code.
jquast
force-pushed
the
jq/libwcwidth-experiments
branch
from
August 7, 2026 01:52
b2d9a66 to
3998d25
Compare
Merging this PR will improve performance by ×9.3
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #233 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 27 27
Lines 1973 1990 +17
Branches 464 467 +3
=========================================
+ Hits 1973 1990 +17 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ith 'import' and 'import from'' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I am creating a draft PR for the purpose of working with CI workflows of building wheels and to see performance results of codspeed.
This is only a draft, and will be under review and revision for a while longer, especially the documentation.