acra-storage icon indicating copy to clipboard operation
acra-storage copied to clipboard

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

Open davcamer opened this issue 11 years ago • 2 comments

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 avatar Nov 30 '13 18:11 davcamer

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.

davcamer avatar Jan 12 '14 04:01 davcamer

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.

KevinGaudin avatar Jan 13 '14 20:01 KevinGaudin