ACRA / acra-storage

GNU General Public License v3.0
49 stars 32 forks source link

Key bugs using a 32-bit signed int calculated using a fast hash #6

Open davcamer opened 10 years ago

davcamer commented 10 years ago

The hash algorithm is based on Java's String.hashCode

Code was taken from a response on StackOverflow: http://stackoverflow.com/questions/7616461/generate-a-hash-from-string-in-javascript-jquery

This cut indexing time by 50% and index size by 20%. Nothing is free though, and insert time is increased by 25%.

Inserting 1000 documents is still 6x faster than indexing them.

davcamer commented 10 years ago

Here's the larger set of changes we've made on our acra-storage deployment. Through some poor decisions about reporting, we ended up with a VERY large set of crash reports -- millions. These changes greatly improved the size and speed of our couch instance. Indexing was an order of magnitude faster.

I had been waiting to see if the initial change that keys bugs by hash code was accepted, but thinking about it more, it seems better to get the full range of changes in the open. With the full picture, any discussion of individual changes might be easier.

KevinGaudin commented 10 years ago

I'm sorry for coming late here, time is hard to find these days.

Thanks a lot for your contribution, I'm starting to review your proposed changes.