This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rosslagerwall
Recipients alexandre.vassalotti, grooverdan, rosslagerwall, thijs, wangchun
Date 2011-01-22.08:56:17
SpamBayes Score 1.23212e-05
Marked as misclassified No
Message-id <>
Attached is a patch based on the original patch, meant to have better performance.

On my PC, this:

import sys, time, uuid

def uu(n):
    t = time.time()
    for x in range(n):
    print('%.3f microseconds' % ((time.time() - t) * 1000000.0 / n))


records a time of 38.5 microseconds unpatched (still using ctypes/libuuid) and a time of 16.5 microseconds afterwards.
uuid4() results in an improvement from 30 microseconds to 9 microseconds. From what I could see, what took the most time was the call to UUID() with a bytes object. That's why this patch passes in the uuid as a long.

It also fixes to check for the uuid.h header.
Date User Action Args
2011-01-22 08:56:20rosslagerwallsetrecipients: + rosslagerwall, alexandre.vassalotti, wangchun, thijs, grooverdan
2011-01-22 08:56:20rosslagerwallsetmessageid: <>
2011-01-22 08:56:18rosslagerwalllinkissue5885 messages
2011-01-22 08:56:18rosslagerwallcreate