Skip to content

gh-131196: Improve perfomance of UUID.hex and UUID.__str__ by using bytes.hex() #131197

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

Merged
merged 5 commits into from
Mar 13, 2025

Conversation

booqoffsky
Copy link
Contributor

@booqoffsky booqoffsky commented Mar 13, 2025

@ghost
Copy link

ghost commented Mar 13, 2025

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Mar 13, 2025

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@booqoffsky booqoffsky marked this pull request as ready for review March 13, 2025 16:56
@picnixz picnixz self-assigned this Mar 13, 2025
booqoffsky and others added 2 commits March 13, 2025 22:29
Co-authored-by: Bénédikt Tran <[email protected]>
Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Nice improvement! 10% speed up is good enough for such a short PR in my opinon.

Copy link
Member

@picnixz picnixz left a comment

Choose a reason for hiding this comment

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

I'll merge this one tomorrow or @sobolevn can do it now if he's got time (I'm too tired to make a nice commit title and message :'))

@sobolevn sobolevn merged commit 1121c80 into python:main Mar 13, 2025
43 checks passed
plashchynski pushed a commit to plashchynski/cpython that referenced this pull request Mar 17, 2025
…by ~10% (python#131197)

Results before and after the fix:

```
hex
before: 0.021755493999989994
after:  0.01465080400066654 

str
before: 0.06381790500017814
after:  0.05134949700004654
```

Co-authored-by: Bénédikt Tran <[email protected]>
seehwan pushed a commit to seehwan/cpython that referenced this pull request Apr 16, 2025
…by ~10% (python#131197)

Results before and after the fix:

```
hex
before: 0.021755493999989994
after:  0.01465080400066654 

str
before: 0.06381790500017814
after:  0.05134949700004654
```

Co-authored-by: Bénédikt Tran <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants