>>>>> "Bo" == Bo Peng <[EMAIL PROTECTED]> writes:
>> What about using short ints instead of ints? Bo> I do not know what exactly is going on here, but if there are a Bo> lot of duplicates, std::map should help. A std::map is what we had, but a vector is faster. Of course the downside is that it costs much more memory. The question is how to mitigate this. I see * using short ints : this means that the cache struct uses 6 bytes instead of 12 (unless alignement comes into play) * using an array of pointers to cache. Most entries will use 4 bytes, and some will need 4+12 (or 4+6) bytes. * something more complicated like an array of 256 pointers to arrays of cache struct. There we should see much bigger gains, and the price in performance might be negligible. * using a QHash as Abdel proposes. Personally, using 20M of memory just because we can is not acceptable. JMarc
