Author kevinlondon
Recipients kevinlondon, ronaldoussoren
Date 2014-08-04.02:05:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407117956.69.0.92579582172.issue22131@psf.upfronthosting.co.za>
In-reply-to
Content
Generating the byte representation of a UUID object can be a little faster by using binascii's unhexlify on the hex value of the UUID object. In my testing, I saw about a 5.5x speed increase with the attached changes. 

Here are a set of benchmarks that I ran, which are inspired by Wang Chun's benchmarks on http://bugs.python.org/issue5885:

https://gist.github.com/kevinlondon/d3bb32d5a784f78731fa

My times:

kevin$ python uuid_benchmark.py 100000
Original Average: 8.049 microseconds
Updated Average: 1.447 microseconds
 
I re-ran all of the tests with the patched uuid module and they passed. Here's my patchcheck output as well:

kevin$ make patchcheck
./python.exe ./Tools/scripts/patchcheck.py
Getting the list of files that have been added/changed ... 1 file
Fixing whitespace ... 0 files
Fixing C file whitespace ... 0 files
Fixing docs whitespace ... 0 files
Docs modified ... NO
Misc/ACKS updated ... NO
Misc/NEWS updated ... NO
configure regenerated ... not needed
pyconfig.h.in regenerated ... not needed

Thanks!
History
Date User Action Args
2014-08-04 02:05:56kevinlondonsetrecipients: + kevinlondon, ronaldoussoren
2014-08-04 02:05:56kevinlondonsetmessageid: <1407117956.69.0.92579582172.issue22131@psf.upfronthosting.co.za>
2014-08-04 02:05:56kevinlondonlinkissue22131 messages
2014-08-04 02:05:55kevinlondoncreate