|
From: Christoph B. <bar...@or...> - 2006-10-25 08:12:44
|
Am Dienstag, 24. Oktober 2006 22:27 schrieb Julian Seward: > > > hash = (hash << 61) | (hash >> 3); > > > > > > leads to a better distribution of the values and better runtime for the > > > testcase. However I do not know whether rotation by 3 really leads to a > > > good hash function for 64 bit. > > > > Yeh, rotating by 3 is stupid and doesn't mix the bits well for short > > stack traces. I just tried this, which mixes much better: > > Below is my final patch. It works well (it seems) for both 32-bit > and 64-bit versions of your test program and contains a second > heuristic hack to guard against bad-case behaviour. Can you let me > know if it solves the problem convincingly? If so I will commit it. The main application runs faster now. One run of the algorithm: Old valgrind: 144765 seconds New valgrind: 17232 seconds Without valgrind: 251 seconds Although this is nearly ten times faster than the old version it is still quite slow for me with a slowdown factor of 68x. But I guess that memcheck cannot run faster. Thanks Christoph Bartoschek |