Skip to content
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

Performance improvements #11

Merged
merged 3 commits into from
Sep 22, 2021
Merged

Performance improvements #11

merged 3 commits into from
Sep 22, 2021

Conversation

akx
Copy link
Member

@akx akx commented Sep 21, 2021

Based on the perftest script that's being run in GitHub Actions (I know, may be affected by noisy neighbors), this PR increases the performance of generating new ULIDs rather markedly.

platform master #11 Δ
py2.7 68k ops/s 83k ops/s +21.1%
py3.8 174k ops/s 249k ops/s +43.3%

After these optimizations, the hottest function is the uuid.UUID() constructor (which probably could be simpler...). I do have an experimental commit that would sidestep it, but I'm not sure it's safe for general consumption.

@akx akx marked this pull request as ready for review September 21, 2021 13:00
Copy link
Member

@ruksi ruksi left a comment

Choose a reason for hiding this comment

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

better performance through less twiddling

lgtm

@ruksi ruksi merged commit 75e3d85 into master Sep 22, 2021
@ruksi ruksi deleted the perf branch September 22, 2021 07:08
akx added a commit that referenced this pull request Sep 22, 2021
akx added a commit that referenced this pull request Sep 22, 2021
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.

2 participants