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

Micro-optimize _to_rgba_no_colorcycle.#30020

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
QuLogic merged 1 commit intomatplotlib:mainfromanntzer:trnc
May 8, 2025
Merged

Conversation

anntzer
Copy link
Contributor

This patch speeds up conversions of#rgba-type formats by between 25% and 40% (while shortening the implementation), although real benefits should be limited because of caching in to_rgba.

PR summary

PR checklist

@tacaswelltacaswell added this to thev3.11.0 milestoneMay 6, 2025
@anntzeranntzerforce-pushed thetrnc branch 2 times, most recently fromf3f2c44 to9dc9749CompareMay 7, 2025 06:26
return (*[n / 0xff for n in bytes.fromhex(c[1:])],
alpha if alpha is not None else 1.)
elif len(c) == 4: # #rgb hex format, shorthand for #rrggbb.
return (*[int(n, 16) * 0x11 / 0xff for n in c[1:]],
Copy link
Member

Choose a reason for hiding this comment

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

This is just ?

Suggested change
return (*[int(n,16)*0x11/0xffforninc[1:]],
return (*[int(n,16)/0xfforninc[1:]],

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

ah indeed, even better.

This patch speeds up conversions of `#rgba`-type formats by between 25%and 40% (while shortening the implementation), although real benefitsshould be limited because of caching in to_rgba.
@tacaswell
Copy link
Member

@story645 Did you mean to close this?

@tacaswelltacaswell reopened thisMay 7, 2025
@story645
Copy link
Member

@story645 Did you mean to close this?

No sorry, my phone's been a little broken and I was probably looking at this on the app and accidentally closed it w/o noticing☹️

@QuLogicQuLogic merged commit6dcfa9d intomatplotlib:mainMay 8, 2025
55 of 64 checks passed
@anntzeranntzer deleted the trnc branchMay 8, 2025 19:43
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.11.0
Development

Successfully merging this pull request may close these issues.

5 participants
@anntzer@tacaswell@story645@QuLogic@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp