[Do Not Merge] Some benchmarks and insights#6
Open
ahsanbarkati wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hey - It was fun playing around with this code. This PR is not meant to be merged, but only for the purpose of some demonstration. Sorry for a lot of refactoring, even changing the package name. But it was necessary to resolve some dependency chains. The problem is that gocrank and crank db have same packages in them (cql, server). So one can't be imported to other because of conflict. You should avoid code-duplication.
I have run a few benchmarks, which have the results as follows:
If you observe, with sync maps, the read speed is super fast (almost 9 times faster). And if this is meant to be a read-heavy DB, then sync map is a better option (which has write speed x0.5 while read x9).
Second, I feel, rather than having an interface in the value, you should consider having just a byte slice. Interface conversion is heavy operation and mostly KVs are used for string, byte slices etc.