Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add bm_base64 covering common base64 module APIs#447

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

Merged
gpshead merged 6 commits intopython:mainfromgpshead:add-bm_base64
Jan 3, 2026

Conversation

@gpshead
Copy link
Member

Motivationpython/cpython#143262 but also in general this wasn't covered and@serhiy-storchaka is also doing work in this area that'll become relevant such aspython/cpython#143216.

@gpshead

This comment was marked as resolved.

@gpsheadgpshead marked this pull request as ready for reviewDecember 29, 2025 05:59
Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

What are the results and the total time?

My suggestions:

  • Test an ASCII string input for decoding.
  • Balance encoding and decoding.

gpshead reacted with thumbs up emoji
@gpshead
Copy link
MemberAuthor

Example results comparing before and afterpython/cpython#143262.

main-before-opt-b64.json========================Performance version: 1.14.0Python version: 3.15.0a3+ (64-bit) revision 6b9a6c6ec3bReport on Linux-6.17.0-8-generic-x86_64-with-glibc2.42Number of logical CPUs: 15Start date: 2026-01-02 06:47:53.863590End date: 2026-01-02 06:54:17.985677main-after-opt-b64.json=======================Performance version: 1.14.0Python version: 3.15.0a3+ (64-bit) revision 61fc72a4a43Report on Linux-6.17.0-8-generic-x86_64-with-glibc2.42Number of logical CPUs: 15Start date: 2026-01-02 06:30:08.791666End date: 2026-01-02 06:36:26.047033### ascii85_large ###Mean +- std dev: 1.04 sec +- 0.01 sec -> 1.03 sec +- 0.01 sec: 1.01x fasterNot significant### ascii85_small ###Mean +- std dev: 20.7 ms +- 0.3 ms -> 20.6 ms +- 0.4 ms: 1.00x fasterNot significant### base16_large ###Mean +- std dev: 6.39 ms +- 0.06 ms -> 6.36 ms +- 0.04 ms: 1.00x fasterNot significant### base16_small ###Mean +- std dev: 376 us +- 3 us -> 372 us +- 3 us: 1.01x fasterNot significant### base32_large ###Mean +- std dev: 585 ms +- 8 ms -> 586 ms +- 7 ms: 1.00x slowerNot significant### base32_small ###Mean +- std dev: 11.4 ms +- 0.1 ms -> 11.5 ms +- 0.1 ms: 1.00x slowerNot significant### base64_large ###Mean +- std dev: 4.66 ms +- 0.03 ms -> 2.06 ms +- 0.01 ms: 2.26x fasterSignificant (t=749.12)### base64_small ###Mean +- std dev: 314 us +- 5 us -> 253 us +- 5 us: 1.24x fasterSignificant (t=64.73)### base85_large ###Mean +- std dev: 432 ms +- 4 ms -> 431 ms +- 4 ms: 1.00x fasterNot significant### base85_small ###Mean +- std dev: 8.37 ms +- 0.08 ms -> 8.39 ms +- 0.12 ms: 1.00x slowerNot significant### urlsafe_base64_small ###Mean +- std dev: 511 us +- 5 us -> 445 us +- 4 us: 1.15x fasterSignificant (t=80.03)

Copy link
Member

@serhiy-storchakaserhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I am going to add alsoignorechars to support decoding multi-line data. So it may be worth to separate "raw" and "multi-line" cases, if we want to compare the effect of optimization. We could also separate encoding and decoding. But then we will have too much tests. So this is up to you.

@gpshead
Copy link
MemberAuthor

yeah i'd initially started out with separate encode/decode but the matrix of benchmark cases got large and pyperformance is not really intended as a microbenchmark. improvements in any of these will be reflected in the overall scores.

@gpsheadgpshead merged commit0976e4a intopython:mainJan 3, 2026
19 checks passed
maurycy added a commit to maurycy/pyperformance that referenced this pull requestJan 23, 2026
* main:  Replace pre-commit with prek in CI and add cooldown to Dependabot (python#452)  Add bm_base64 covering common base64 module APIs (python#447)
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@serhiy-storchakaserhiy-storchakaserhiy-storchaka approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@gpshead@serhiy-storchaka

[8]ページ先頭

©2009-2026 Movatter.jp