Skip to content

Simplifying ascii-decode #123894

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

Closed
rhpvorderman opened this issue Sep 10, 2024 · 1 comment
Closed

Simplifying ascii-decode #123894

rhpvorderman opened this issue Sep 10, 2024 · 1 comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@rhpvorderman
Copy link
Contributor

rhpvorderman commented Sep 10, 2024

Feature or enhancement

Proposal:

This is a trivial enhancement of the ascii_decode function in unicodeobject.c. By using memcpy on unaligned pointers, the compiler will use unaligned loads on platforms that support it. Most platforms do.

Currently the ascii_decode function looks very byzantine. By writing it slightly differently using memcpy, lots of lines can be removed while also becoming more readable in my opinion.

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

Linked PRs

@rhpvorderman rhpvorderman added the type-feature A feature request or enhancement label Sep 10, 2024
@picnixz picnixz added extension-modules C modules in the Modules dir interpreter-core (Objects, Python, Grammar, and Parser dirs) and removed extension-modules C modules in the Modules dir labels Sep 10, 2024
@vstinner
Copy link
Member

I close the issue since the PR was closed: #123895

@terryjreedy terryjreedy closed this as not planned Won't fix, can't repro, duplicate, stale Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants