rdp / google_hash

wrapper for google's hash functions, for ruby
BSD 3-Clause "New" or "Revised" License
92 stars 16 forks source link

support BigNum #7

Closed rdp closed 14 years ago

rdp commented 14 years ago

If somebody might ever use it :P

kostyasys commented 14 years ago

Now you have Long support but nobody can actually use it becouse you check everithing for Fixnum. One of the main reasons to use google hashes besides performanse is to hide tons of objects away from ruby GC.

rdp commented 14 years ago

interesting. You're totally right. The current support for long is equal to the support for int's. So is this a request to automagically convert BigNum's to long double's? What do you want exactly?

rdp commented 14 years ago

k just pushed 0.5.0 which removes Long's at all and adds Double's (which also accomodates for BigNum's).

So basically you've got as much precision as double's, now (but no floats yet). Let me know if you want anymore.

kostyasys commented 14 years ago

Thanks for quick fix, i've already deployed it to production :)). This version works for me, but i think Double's support has big overhead, at least it works significantly slower.

In your readme i've seen that you use longs inside, why not to use rb_big2long in all cases except doubles, so your IntToAnything will work like Long2Anything, just like they actually do on lower level.

What about extra hash methods that will make google_hash more like ruby hashes. At least it will be great to have "key_exists?" and "delete" methods.

rdp commented 14 years ago

aren't longs the same size as ints, basically, so having them doesn't gain us much?

Could you fil esome new issue's for the missing API's, one per each? Thanks.

rdp commented 14 years ago

ahh i see your original question now--why not store either double or long depending on what is passed in--is that correct?