liufengyun / hashdiff

Hashdiff is a ruby library to to compute the smallest difference between two hashes
MIT License
560 stars 63 forks source link

Return empty array when both hashes are empty #57

Closed krzysiek1507 closed 5 years ago

krzysiek1507 commented 5 years ago
obj1 = obj2 = {:a=>{}, :b=>{}, :c=>{}, :d=>{}, :e=>{}}

Warming up --------------------------------------
              master     2.118k i/100ms
           optimized     2.872k i/100ms
Calculating -------------------------------------
              master     20.641k (± 5.2%) i/s -    103.782k in   5.042570s
           optimized     32.080k (± 5.9%) i/s -    160.832k in   5.033689s

Comparison:
           optimized:    32079.5 i/s
              master:    20640.9 i/s - 1.55x  slower

Calculating -------------------------------------
              master    14.248k memsize (     0.000  retained)
                        80.000  objects (     0.000  retained)
                         5.000  strings (     0.000  retained)
           optimized    12.648k memsize (     0.000  retained)
                        40.000  objects (     0.000  retained)
                         5.000  strings (     0.000  retained)

Comparison:
           optimized:      12648 allocated
              master:      14248 allocated - 1.13x more
liufengyun commented 5 years ago

Thanks a lot @krzysiek1507 🎉

liufengyun commented 5 years ago

Thanks for accepting the invitation @krzysiek1507 . Please feel free to review PRs and merge. You can also push feature branches directly in this repo.

I'll add a maintainer section to the README, if you are OK with it.

krzysiek1507 commented 5 years ago

Thank you @liufengyun!

Sure, you can add it!