jhuckaby / megahash

A super-fast C++ hash table with Node.js wrapper, tested up to 1 billion keys.
Other
411 stars 29 forks source link

Improve performance of a few types #10

Open timotejroiko opened 3 years ago

timotejroiko commented 3 years ago

Hey,

I ended up focusing on some improvements for the less important data types and flags. Additionally i added some more tests and updated dependencies because why not.

Anyways feel free to take a look, test and pick what you like. If you don't like some specific change let me know and i'll revert

Cheers!


package.json

Update dependencies

test.js

Added tests for:

test-bench2.js

Added benchmarks for measuring performance of different data types

main.js

Changes:

hash.cc

Added short-circuiting for flag-only types

Performance changes:

jhuckaby commented 3 years ago

Hey @timotejroiko, thanks so much for this! I'll take a look as soon as I have some time.

jhuckaby commented 3 years ago

Hey @timotejroiko,

So I have to apologize. I had a bunch of MegaHash changes in my local repo from many months ago that I didn't finish, and kind of forgot about. I really wanted to get those committed, pushed and tagged before I worked on your fork.

Part of these changes was cleaning up the repo folders a bit, and I moved the test scripts into a new test/ subdirectory, and completely redesigned the benchmarking script.

Would it be possible for you to move your test script into there as well? Also, can we rename it from test-bench2.js to something like test-types.js?

I think most of your other changes are "mergeable", and won't conflict with what I changed.

Thanks, and sorry!

timotejroiko commented 3 years ago

no worries :) im working on some other stuff but i'll get back on it soon.

timotejroiko commented 3 years ago

i've rebased and moved the file to the test folder, let me know if theres anything else i can do :)

mfcodeworks commented 2 years ago

Any update on these @jhuckaby? These PRs look pretty great in what they can provide for the repo