From b0efe6f1656aa334b7f1e456ac02f00262217413 Mon Sep 17 00:00:00 2001 From: alexisvisco Date: Wed, 27 Mar 2019 15:27:04 +0100 Subject: [PATCH] update readme --- cmd/example/main.go | 2 +- readme.md | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cmd/example/main.go b/cmd/example/main.go index 5c25254..3271181 100644 --- a/cmd/example/main.go +++ b/cmd/example/main.go @@ -14,7 +14,7 @@ func main() { // I will ignore all errors for demonstration purposes - _, _ = ingester.BulkPush("movies", "general", 2, []sonic.IngestBulkRecord{ + _, _ = ingester.BulkPush("movies", "general", 3, []sonic.IngestBulkRecord{ {"id:6ab56b4kk3", "Star wars"}, {"id:5hg67f8dg5", "Spider man"}, {"id:1m2n3b4vf6", "Batman"}, diff --git a/readme.md b/readme.md index 52f1e62..274e6ef 100644 --- a/readme.md +++ b/readme.md @@ -44,4 +44,22 @@ func main() { fmt.Println(results) } -``` \ No newline at end of file +``` + +### Benchmark bulk + +Method BulkPush and BulkPop use custom connection pool with goroutine dispatch algorithm. +This is the benchmark (file sonic/ingester_test.go): + +``` +goos: linux +goarch: amd64 +pkg: github.com/expectedsh/go-sonic/sonic +BenchmarkIngesterChannel_BulkPushMaxCPUs-8 2 662657959 ns/op +BenchmarkIngesterChannel_BulkPush10-8 2 603779977 ns/op +BenchmarkIngesterChannel_Push-8 1 1023322864 ns/op +PASS +``` + +Bulk push is faster than for loop on Push. +Hardware detail: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz \ No newline at end of file