sentry-python icon indicating copy to clipboard operation
sentry-python copied to clipboard

Swap UUID generation to be lazy

Open bayangan1991 opened this issue 2 years ago • 2 comments

Running py-spy while the sentry sdk in a django project shows that there is a lot of time spent generating un-used uuid.

This PR simply takes the same UUID format and puts it's behind some custom getter and setter code.

Just in a fairly large django project start I saw number of UUID's used go from several hundred thousand to hundreds.

bayangan1991 avatar May 23 '23 04:05 bayangan1991

hey @bayangan1991 thanks for the PR, that's a valuable observation.

I'm actually working on some more general 'make the SDK as low overhead as possible', so I'll take this into account for that. I'll keep this PR open for now and come back to you in some time on if we take this in or I incorporate avoiding UUID / span creation in some other way.

sl0thentr0py avatar May 23 '23 12:05 sl0thentr0py

ty! I'll merge this on monday after some quick sanity testing on django

sl0thentr0py avatar Jun 23 '23 12:06 sl0thentr0py

im gonna reopen this separately since we dont have rights for the fork

sl0thentr0py avatar Mar 15 '24 13:03 sl0thentr0py