Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34k
gh-144264: Speed up Base64 decoding of data containing ignored characters#144265
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
gh-144264: Speed up Base64 decoding of data containing ignored characters#144265
Conversation
…charactersTry the fast path again after decoding a quad the slow path.Use a bitmap cache for the ignorechars argument.
Modules/binascii.c Outdated
| if (ignorechars->buf==NULL) { | ||
| return0; | ||
| } | ||
| if (ignorecache[c >>8]& (1 << (c&7))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
There are compiler warnings on Windows: "Check warning:
'>>': right shift by too large amount, data loss".
Are you sure about thec >> 8 shift? It always return 0, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Good catch! It should bec >> 3 orc / 8.
Added tests for such kind of errors.
vstinner left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
Uh oh!
There was an error while loading.Please reload this page.
Try the fast path again after decoding a quad the slow path. Use a bitmap cache for the ignorechars argument.