On 1/24/08, Linus Torvalds <torvalds@linux-foundation.org> wrote:Well, although this is very clever approach, I suggest against it. You'll end up with complex code that gives out substandard results. I think its better to have separate case-folding function (or several), that copies string to temp buffer and then run proper optimized hash function on that buffer. That way you can use already tested building blocks and can optimize both sides separately. Eg. the folding-only function can aswell be optimized to load 4 or 8-byte at-a-time. This also isolates hashing from exact details how folding happens to access the input string which seem to be the weak point in your approach. (In both collision and complexity sense.) Such temp buffer happens to fits my lookup3_memcpy also better (heh). Its weak point is that on platforms that do not allow unaligned access, it degenerates to byte-by-byte loading. But if know you always have aligned buffer, you can notify gcc to do 4-byte fetch there too. It should be as simple as tagging data pointer as uint32_t *. Anyway, now you dont need to worry about folding when picking hash. If your input strings are over kilobyte on average then I'd agree with you, but if you process 20-30 bytes on average, is the additional complexity worth it? -- marko - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
| Eric Paris | TALPA - a threat model? well sorta. |
| Vladislav Bolkhovitin | Re: Integration of SCST in the mainstream Linux kernel |
| Andrew Morton | Re: [BUILD-FAILURE] 2.6.26-rc8-mm1 - x86 - __ptep_modify_prot_start() missing |
| Bodo Eggert | Re: [PATCH] x86: provide a DMI based port 0x80 I/O delay override. |
git: | |
| Pavel Roskin | Implementing branch attributes in git config |
| Jon Smirl | Importing Mozilla CVS into git |
| Jon Smirl | Figured out how to get Mozilla into git |
| Jakub Narebski | Re: VCS comparison table |
| Richard Stallman | Real men don't attack straw men |
| Adam Getchell | Re: About Xen: maybe a reiterative question but .. |
| carlopmart | About Xen: maybe a reiterative question but .. |
| Bertram Scharpf | First install: Grub doesn't find partitions |
| Waskiewicz Jr, Peter P | RE: [PATCH 2/3][NET_BATCH] net core use batching |
| Jeff Kirsher | [PATCH 1/3] e1000e: add support for the 82567LM-4 device |
| Ayaz Abdulla | [PATCH] forcedeth: msi interrupts |
| Corey Hickey | [PATCH 10/10] Use nested compat attributes to pass parameters. |
