|
From: James W. W. <ja...@wr...> - 2004-11-04 19:01:52
|
Dair Grant <da...@re...> wrote: >This was actually one of the changes that came up when looking at >Roger's changes to the way instance data is found; the existing hash >function turned out to be really quite suboptimal (use of % generates an >expensive divide), and so replacing that was definitely a good idea. > >I actually had it changed here too, but never got round to checking it >in - thanks! :-) Did you change it the same way? I didn't get rid of the % operation entirely, just reduced from 4 times to one. If we could require that the table size is always a power of 2, then we could replace x % tableSize by x & (tableSize - 1). Do you suppose that would be worthwhile? -- James W. Walker, ScriptPerfection Enterprises, Inc. <http://www.write-brain.com/> |