RandomPool initialization is slow on Windows

Bug #248522 reported by A.M. Kuchling
2
Affects Status Importance Assigned to Milestone
Python-Crypto
Won't Fix
Undecided
John A Meinel

Bug Description

See discussion in http://article.gmane.org/gmane.comp.version-control.bazaar-ng.general/43874 .

Excerpt: In RandomPool.__init__() ...

However, time.time() on windows only has a resolution of ~15ms. So
getting 100 new ticks takes... 15ms * 100 = 1.5s (no surprise there).

It turns out that on *windows* you should be using time.clock() which
uses a high resolution timer. (On Linux, time.clock() measures CPU time,
which isn't good for this particular use.)

Revision history for this message
John A Meinel (jameinel) wrote :

I just put together a patch for this. I don't know how it fits with the overall code base, but at least it is consistent within randompool.py

Changed in pycrypto:
assignee: nobody → jameinel
status: New → Confirmed
Revision history for this message
John A Meinel (jameinel) wrote :

Just uploading the same change as a patch, since I don't know if a branch is preferred.

Revision history for this message
Darsey Litzenberger (dlitz) wrote :

I'm not going to bother fixing this, since RandomPool is now deprecated anyway.

See Bug #249765 and http://lists.dlitz.net/pipermail/pycrypto/2008q3/000020.html.

Changed in pycrypto:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.