-
Notifications
You must be signed in to change notification settings - Fork 0
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
First version of turbo cache #2
Open
andectionsharechat
wants to merge
165
commits into
main
Choose a base branch
from
v1
base: main
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.
+1,735
−197,079
Open
Changes from all commits
Commits
Show all changes
165 commits
Select commit
Hold shift + click to select a range
32e2517
introduced private set without lock
andectionsharechat eb82c00
naive batch write implementation
andectionsharechat 18a0729
small cleans
andectionsharechat 1eef94d
fixed writing cache error
andectionsharechat 675daf7
updated go modele name
andectionsharechat b173153
increased timer interval
andectionsharechat 1638d94
updated parameters a bit
andectionsharechat cf5459d
tuned contention parameters
andectionsharechat 5f66907
removed useless set
andectionsharechat 250649c
updated package name
andectionsharechat 2b137a7
fixed tests
andectionsharechat 254b7f2
fixed tests
andectionsharechat 2cc0b1b
updated module name
andectionsharechat 28aff5b
fixed big cache panic
andectionsharechat 0b54936
fixed all tests
andectionsharechat 0c369fe
changed bucket to 512
andectionsharechat 75755e0
fixed tests
andectionsharechat 45f5fb1
fixed race condition
andectionsharechat 02823fe
increase go version
andectionsharechat 3d79619
fixed go version in ci
andectionsharechat 5da66c8
fixed test
andectionsharechat 575c5b2
code clean
andectionsharechat fd775cd
code clean
andectionsharechat 182b934
cleaned code
andectionsharechat 81828ae
fixing tests
andectionsharechat c745332
code clean
andectionsharechat 3dcc29a
stabilize tests
andectionsharechat 835b2ac
added sync write
andectionsharechat 0808cce
simplifed tests
andectionsharechat 7e2ea4a
drop on high contention
andectionsharechat f7ed73e
added drop writes stats
andectionsharechat 8d1a9a8
reduced buffer size
andectionsharechat 9f93372
increased buffer size
andectionsharechat ad4b5db
collect write queue stats
andectionsharechat 4c8deac
increased bucket count
andectionsharechat d0bf3a3
reduced bucket count
andectionsharechat dcbd030
make deduplication
andectionsharechat 86699e3
increased init size of buffer
andectionsharechat b6546b1
huge number of buckets
andectionsharechat 10a73ae
updated bucket count
andectionsharechat 0c37dc8
reduced critical section
andectionsharechat 28daa89
Added naive limiter
andectionsharechat 137c9dd
improved dedup logic
andectionsharechat b0eb5b5
removed limiter
andectionsharechat 36f55a0
fixed dedup logic
andectionsharechat 5ecf4b9
small optimisation
andectionsharechat 73c032b
intorduced limiter
andectionsharechat 3d75efe
fixed test
andectionsharechat bb440b1
removed hash and pointer allocation
andectionsharechat df043b8
rollback idea of smart dedup
andectionsharechat 1689be0
reduced memory allocation
andectionsharechat c6c650a
fixed limiter
andectionsharechat a9546ef
increased bucket count
andectionsharechat cc8bfba
removing limiting
andectionsharechat a8217bd
bucket count
andectionsharechat 5424c8b
added bucket stats
andectionsharechat 283b56b
bucket count 2048
andectionsharechat 4a267a8
reduced gc allocation in buffering
andectionsharechat 2e19dfb
reduced batch write cpu
andectionsharechat 9aeadf2
fixed bug with batching
andectionsharechat 50d0ed6
fixed out of range exception
andectionsharechat 21df6ee
reduced bucket count
andectionsharechat 131230e
reduced bucket count
andectionsharechat 72a6c0f
key dedup
andectionsharechat cb654b2
dedup fixes
andectionsharechat 7934c26
code clean
andectionsharechat cc9feb3
increased buckets
andectionsharechat 54efc59
added different l1 implementation
andectionsharechat b32bedb
added different l1 implementation
andectionsharechat d51fb37
fixed race condition
andectionsharechat 9a03788
fixed bug
andectionsharechat a8b1fdf
not blocking send to channel
andectionsharechat fd6e721
fixed dropped writes metrics
andectionsharechat 3fdc004
collect proper metrics
andectionsharechat 3b2cfc5
collect proper metrics of dropped writes
andectionsharechat 9843802
Merge remote-tracking branch 'origin/bucket_experiments' into bucket_…
andectionsharechat 33360b7
increased proportion of write buffer
andectionsharechat 7692384
pointer count optimisation
andectionsharechat bca1d9f
support big values
andectionsharechat 3fd133e
benchmarking
andectionsharechat 7cf377a
optimised batch set
andectionsharechat 35824cd
fixed chunkIdx update
andectionsharechat 36b2a4a
code clean
andectionsharechat 53c2633
added unit tests on new item processing
andectionsharechat d4908a1
added unit tests on new item processing
andectionsharechat c07a0b9
incremental change
andectionsharechat 557d5c8
incremental change
andectionsharechat 9335e91
concurrent test
andectionsharechat 260465e
incremental change
andectionsharechat f2879be
concurrency
andectionsharechat 4a7d041
code clean
andectionsharechat a7bae81
fixed race condition
andectionsharechat 150addf
code clean
andectionsharechat 607e916
code clean
andectionsharechat e25ae43
code clean
andectionsharechat 490bb42
code clean
andectionsharechat 532e508
code clean
andectionsharechat a029f9e
fixed test
andectionsharechat 0d1dc9b
code clean
andectionsharechat 0e0d4ed
rollback sync set
andectionsharechat c9988a4
code clean
andectionsharechat a004ac2
code clean
andectionsharechat 8a4a755
code clean
andectionsharechat 79b3bc8
incremental change
andectionsharechat e96156d
fixed bugs with cleaning
andectionsharechat 81f2989
removed test
andectionsharechat c47979b
code cleaned
andectionsharechat 29d4b1d
removed unnececary tests
andectionsharechat 0adfd57
code clean
andectionsharechat e0bc824
code clean
andectionsharechat eb9f8bb
fixed version
andectionsharechat d0e80da
fixed tests
andectionsharechat e7f1716
fixed tests
andectionsharechat 0294c31
code clean
andectionsharechat 37f1fa2
try build fixing
andectionsharechat 3c2d114
stabilise tests
andectionsharechat 23de532
try to fix build
andectionsharechat 9d786ae
fixed the build
andectionsharechat 274f0cc
fixed the build
andectionsharechat c55330a
fixed the build
andectionsharechat 0abcc63
fixed the build
andectionsharechat 0e24360
code clean
andectionsharechat 19ef6c8
code clean
andectionsharechat 8035011
update chunks atomic pointer before index
andectionsharechat 1d577d4
code clean
andectionsharechat ed8103c
code clean
andectionsharechat c0a6697
code clean
andectionsharechat 7248863
added trubo cache vs fast cache benchmark
andectionsharechat 83958fa
code clean
andectionsharechat f3b9126
renamed refactoring
andectionsharechat 2acd5c2
renoved unused methods
andectionsharechat b3d97eb
simplified syncronization
andectionsharechat 96edcdc
simplified syncronisation
andectionsharechat 0cb9b01
normalized benchmark
andectionsharechat 22ce66a
code clean
andectionsharechat 45f5e76
code clean
andectionsharechat 81da1f5
code clean
andectionsharechat eb9dac7
release queued struct faster
andectionsharechat d036d32
code clean
andectionsharechat e053095
code clean
andectionsharechat e6a065f
increment refactoring
andectionsharechat 32261f6
increment refactoring
andectionsharechat 80efe16
increment refactoring
andectionsharechat 292b404
fixed test
andectionsharechat d695dd8
incremental refactoring
andectionsharechat 512a2a5
stopped dropping writes on flushs overflow
andectionsharechat 61a148b
code clean
andectionsharechat 82e3435
increment refactoring
andectionsharechat 9299153
increment refactoring
andectionsharechat 904350d
increment refactoring
andectionsharechat a591f0e
remove unnececcary sync primitive
andectionsharechat d49f268
incremental refactoring
andectionsharechat c553f92
incremental refactoring
andectionsharechat fb6ca1a
incremental refactoring
andectionsharechat 2e4d97d
incremental refactoring
andectionsharechat 18d4ca1
incremental refactoring
andectionsharechat 863638c
incremental refactoring
andectionsharechat 48ab725
go mod tidy
andectionsharechat 45a6c80
removed vendor folder
andectionsharechat 4f5f4c7
fixed race condition
andectionsharechat 93b043f
add mutex waits in benchmarks
andectionsharechat 9345432
rename refactoring
andectionsharechat 472b51f
fixed units
andectionsharechat 83b031a
clean code
andectionsharechat f5afb97
fixed sync write bug
andectionsharechat File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 file contains 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 file contains 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 file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,74 @@ | ||
package fastcache | ||
package turbocache | ||
|
||
import ( | ||
"github.com/ShareChat/turbo-cache/internal/benchmarking" | ||
"github.com/VictoriaMetrics/fastcache" | ||
"testing" | ||
) | ||
|
||
func BenchmarkSetBig(b *testing.B) { | ||
key := []byte("key12345") | ||
value := createValue(256*1024, 0) | ||
c := New(1024 * 1024) | ||
c := New(newCacheConfigBenchmarkParams(1024 * 1024)) | ||
b.SetBytes(int64(len(value))) | ||
b.ReportAllocs() | ||
b.ResetTimer() | ||
mutexMetrics := benchmarking.NewMutexMetricsCollector() | ||
b.RunParallel(func(pb *testing.PB) { | ||
for pb.Next() { | ||
key[0]++ | ||
c.SetBig(key, value) | ||
} | ||
}) | ||
mutexMetrics.Report(b) | ||
} | ||
|
||
func BenchmarkGetBig(b *testing.B) { | ||
key := []byte("key12345") | ||
value := createValue(265*1024, 0) | ||
c := New(1024 * 1024) | ||
c := New(newCacheConfigBenchmarkParams(1024 * 1024)) | ||
c.SetBig(key, value) | ||
b.SetBytes(int64(len(value))) | ||
b.ReportAllocs() | ||
b.ResetTimer() | ||
mutexMetrics := benchmarking.NewMutexMetricsCollector() | ||
b.RunParallel(func(pb *testing.PB) { | ||
var buf []byte | ||
for pb.Next() { | ||
buf = c.GetBig(buf[:0], key) | ||
} | ||
}) | ||
mutexMetrics.Report(b) | ||
} | ||
|
||
func BenchmarkFastCacheSetBig(b *testing.B) { | ||
key := []byte("key12345") | ||
value := createValue(256*1024, 0) | ||
c := fastcache.New(1024 * 1024) | ||
b.SetBytes(int64(len(value))) | ||
b.ReportAllocs() | ||
mutexMetrics := benchmarking.NewMutexMetricsCollector() | ||
b.RunParallel(func(pb *testing.PB) { | ||
for pb.Next() { | ||
c.SetBig(key, value) | ||
} | ||
}) | ||
mutexMetrics.Report(b) | ||
} | ||
|
||
func BenchmarkFastCacheGetBig(b *testing.B) { | ||
key := []byte("key12345") | ||
value := createValue(265*1024, 0) | ||
c := fastcache.New(1024 * 1024) | ||
c.SetBig(key, value) | ||
b.SetBytes(int64(len(value))) | ||
b.ReportAllocs() | ||
mutexMetrics := benchmarking.NewMutexMetricsCollector() | ||
b.RunParallel(func(pb *testing.PB) { | ||
var buf []byte | ||
for pb.Next() { | ||
buf = c.GetBig(buf[:0], key) | ||
} | ||
}) | ||
mutexMetrics.Report(b) | ||
} |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the pulling object as we don't control lifecycle here anymore