-
Notifications
You must be signed in to change notification settings - Fork 1
feat: use thread safe cache #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
songgaoye
wants to merge
8
commits into
master
Choose a base branch
from
song/shared_cache
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+212
−4
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
This comment has been minimized.
This comment has been minimized.
Contributor
Author
|
benchmark in branch song/mutex_tree_cahce songgaoye@CNMAC0824 memiavl % go test -bench BenchmarkTreeGet
goos: darwin
goarch: arm64
pkg: github.com/crypto-org-chain/cronos-store/memiavl
cpu: Apple M4 Pro
BenchmarkTreeGet/cache=0-14 19776036 59.26 ns/op
BenchmarkTreeGet/cache=1024-14 5971375 200.2 ns/op
BenchmarkTreeGet/cache=16384-14 5623659 210.6 ns/op
BenchmarkTreeGetParallel/cache=0-14 206333624 5.879 ns/op
BenchmarkTreeGetParallel/cache=1024-14 4949983 263.7 ns/op
BenchmarkTreeGetParallel/cache=16384-14 4774525 251.3 ns/op
PASS
ok github.com/crypto-org-chain/cronos-store/memiavl 12.449s
songgaoye@CNMAC0824 memiavl % go test -bench BenchmarkTreeSet
goos: darwin
goarch: arm64
pkg: github.com/crypto-org-chain/cronos-store/memiavl
cpu: Apple M4 Pro
BenchmarkTreeSet/cache=0-14 11345952 103.2 ns/op
BenchmarkTreeSet/cache=1024-14 5115376 232.0 ns/op
BenchmarkTreeSet/cache=16384-14 7162220 163.6 ns/op |
Contributor
Author
|
benchmark in song/shared_cache songgaoye@CNMAC0824 memiavl % go test -bench BenchmarkTreeGet
goos: darwin
goarch: arm64
pkg: github.com/crypto-org-chain/cronos-store/memiavl
cpu: Apple M4 Pro
BenchmarkTreeGet/cache=0-14 18724959 60.06 ns/op
BenchmarkTreeGet/cache=1024-14 5373397 236.2 ns/op
BenchmarkTreeGet/cache=16384-14 5145981 233.0 ns/op
BenchmarkTreeGetParallel/cache=0-14 204248307 5.863 ns/op
BenchmarkTreeGetParallel/cache=1024-14 11717190 101.8 ns/op
BenchmarkTreeGetParallel/cache=16384-14 11699887 102.4 ns/op
PASS
ok github.com/crypto-org-chain/cronos-store/memiavl 12.279s
songgaoye@CNMAC0824 memiavl % go test -bench BenchmarkTreeSet
goos: darwin
goarch: arm64
pkg: github.com/crypto-org-chain/cronos-store/memiavl
cpu: Apple M4 Pro
BenchmarkTreeSet/cache=0-14 10018656 104.5 ns/op
BenchmarkTreeSet/cache=1024-14 4913354 241.9 ns/op
BenchmarkTreeSet/cache=16384-14 6676912 173.9 ns/op
PASS
ok github.com/crypto-org-chain/cronos-store/memiavl 6.870s |
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.
👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make)make test)go fmt)golangci-lint run)go list -json -m all | nancy sleuth)Thank you for your code, it's appreciated! :)