Message175007
$ ./python -m timeit -s "x = b'a' * int(1E7)" "hash(x)"
Note that hash calculated only once. Add -n 1 option and use a larger data.
> If somebody likes to play with the algorithm:
$ ./python -m timeit -n 1 -s "t = 'abcdefgh' * 10**8" "hash(t)"
1 loops, best of 3: 4.86 sec per loop
Current hash algorithm runs 3.43 sec, V8's algorithm runs 2.44 sec.
With simple optimization I got 3.62 sec, only 6% slower than the current.
#define U8TO64_LE(p) ((u64)((u32 *)(p))[0] | ((u64)((u32 *)(p))[1] << 32)) |
|
Date |
User |
Action |
Args |
2012-11-06 20:12:40 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, lemburg, arigo, vstinner, christian.heimes, benjamin.peterson, Arfrever, alex, dmalcolm, Giovanni.Bajo, PaulMcMillan, Vlado.Boza, koniiiik, camara |
2012-11-06 20:12:40 | serhiy.storchaka | set | messageid: <1352232760.93.0.716753365405.issue14621@psf.upfronthosting.co.za> |
2012-11-06 20:12:40 | serhiy.storchaka | link | issue14621 messages |
2012-11-06 20:12:40 | serhiy.storchaka | create | |
|