Daniel Black <dan...@cacert.org> added the comment:

This is a slightly crude module version. The speedups were only 10%

Python 3.2a0 (py3k:74612M, Sep  1 2009, 18:11:58)                       
[GCC 4.3.2] on linux2  

Using the same test from Wang Chun:
before:
uuid1(1000000)
101.759 microseconds

after:
uuid1(1000000)
91.663 microseconds

The delays are clearly in the _byte array copying as indicated by the
test below:
>>> import sys, time, uuid
>>> def uu(n):
...      t = time.time()
...      for x in range(n):
...         uuid._uuid_generate_time_fast()
...      print('%.3f microseconds' % ((time.time() - t) * 1000000.0 / n))
...
[72265 refs]
>>> uu(1000000)
13.157 microseconds
[72267 refs]

I would expect fixing this for the ctypes version would have a similar
speedup.

----------
keywords: +patch
nosy: +grooverdan
Added file: http://bugs.python.org/file14814/uuid_c_module.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5885>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to