Message175007
| Author |
serhiy.storchaka |
| Recipients |
Arfrever, Giovanni.Bajo, PaulMcMillan, Vlado.Boza, alex, arigo, benjamin.peterson, camara, christian.heimes, dmalcolm, koniiiik, lemburg, serhiy.storchaka, vstinner |
| Date |
2012年11月06日.20:12:40 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1352232760.93.0.716753365405.issue14621@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
$ ./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)) |
|
History
|
|---|
| 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 |
|