diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-08-31 02:19:55 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-08-31 02:19:55 (GMT) |
commit | 7c2a85b2d44851c2442ade579b760f86447bf848 (patch) | |
tree | 7aa5ccb6bf8649c801e3e3c66146fe6325a641a6 /Include | |
parent | 3fa19d7ff89be87139e2864fb9186b424d180a58 (diff) | |
download | cpython-7c2a85b2d44851c2442ade579b760f86447bf848.zip cpython-7c2a85b2d44851c2442ade579b760f86447bf848.tar.gz cpython-7c2a85b2d44851c2442ade579b760f86447bf848.tar.bz2 |
HardwareRandom: Go back to multiplying by 2**-BPF instead of using
ldexp. Both methods are exact, and return the same results. Turns out
multiplication is a few (but just a few) percent faster on my box.
They're both significantly faster than using struct with a Q format
to convert bytes to a 64-bit long (struct.unpack() appears to lose due
to the tuple creation/teardown overhead), and calling _hexlify is
significantly faster than doing bytes.encode('hex'). So we appear to
have hit a local minimum (wrt speed) here.
Diffstat (limited to 'Include')
0 files changed, 0 insertions, 0 deletions