Skip to content
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

compact: Add benchmark for #4084 #4617

Merged
merged 3 commits into from
Sep 14, 2021
Merged

Conversation

zecke
Copy link
Contributor

@zecke zecke commented Aug 31, 2021

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Verification

@zecke zecke force-pushed the zecke/bench-compact branch from ccc52e7 to 6363ef0 Compare August 31, 2021 15:19
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks nice! Can you show an example run of the benchmark test?

@zecke
Copy link
Contributor Author

zecke commented Sep 4, 2021

goos: darwin
goarch: amd64
pkg: github.com/thanos-io/thanos/pkg/compact
cpu: VirtualApple @ 2.50GHz
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10-10-8         	     478	   2567498 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10-20-8         	     480	   2608270 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10-30-8         	     484	   2619140 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10-40-8         	     490	   2605465 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10-50-8         	     478	   2609271 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10-60-8         	     476	   2615486 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-100-10-8        	      46	  25648431 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-100-20-8        	      93	  12734189 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-100-30-8        	     120	  10084033 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-100-40-8        	     158	   7471222 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-100-50-8        	     241	   5062009 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-100-60-8        	     240	   5060903 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-1000-10-8       	       4	 311204156 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-1000-20-8       	       8	 137990490 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-1000-30-8       	      12	  90377771 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-1000-40-8       	      16	  65423945 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-1000-50-8       	      21	  51229673 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-1000-60-8       	      26	  42566138 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10000-10-8      	       1	4993933375 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10000-20-8      	       1	2490431959 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10000-30-8      	       1	1664484417 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10000-40-8      	       1	1243212958 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10000-50-8      	       2	 746272979 ns/op
BenchmarkGatherNoCompactionMarkFilter_Filter/Bench-10000-60-8      	       2	 619553000 ns/op
PASS
ok  	github.com/thanos-io/thanos/pkg/compact	49.791s

Larger win for more blocks.

yeya24
yeya24 previously approved these changes Sep 12, 2021
Copy link
Contributor

@yeya24 yeya24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! cc @bwplotka @GiedriusS for another look.

GiedriusS
GiedriusS previously approved these changes Sep 13, 2021
Copy link
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome work! Just one suggestion. Let me know if it makes sense 👍

pkg/compact/compact_test.go Outdated Show resolved Hide resolved
@zecke zecke dismissed stale reviews from GiedriusS and yeya24 via 6ebfa84 September 13, 2021 13:43
@GiedriusS
Copy link
Member

You got tricked by the GitHub UI 😂 could you add a DCO? Let's merge this

@zecke zecke force-pushed the zecke/bench-compact branch from 6ebfa84 to 7c944e2 Compare September 13, 2021 14:57
@GiedriusS
Copy link
Member

GiedriusS commented Sep 14, 2021

# github.com/thanos-io/thanos/pkg/compact [github.com/thanos-io/thanos/pkg/compact.test]
pkg/compact/compact_test.go:11:2: imported and not used: "os"
pkg/compact/compact_test.go:143:32: undefined: ioutil

Could you please fix these imports?

@zecke zecke force-pushed the zecke/bench-compact branch from 7c944e2 to 21fe4a1 Compare September 14, 2021 13:13
zecke and others added 3 commits September 14, 2021 21:21
Create a bucket that simulates (a non jittering) network RTT to be used
for system like benchmarks.

Signed-off-by: Holger Hans Peter Freyther <[email protected]>
Create a benchmark to show the benefit of adding concurrency
to the no compaction mark filter. Set-up an in-memory bucket
with a simulated (network) delay. In the future we can refactor
this a bit more to test more/all filters.

Fixes: thanos-io#4084
Signed-off-by: Holger Hans Peter Freyther <[email protected]>
Co-authored-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: Holger Hans Peter Freyther <[email protected]>
@zecke zecke force-pushed the zecke/bench-compact branch from 21fe4a1 to 569566d Compare September 14, 2021 13:21
@GiedriusS GiedriusS merged commit d669cd8 into thanos-io:main Sep 14, 2021
someshkoli pushed a commit to someshkoli/thanos that referenced this pull request Nov 7, 2021
* testing: Add a bucket that adds a delay for ops

Create a bucket that simulates (a non jittering) network RTT to be used
for system like benchmarks.

Signed-off-by: Holger Hans Peter Freyther <[email protected]>

* compact: Add benchmark for GatherNoCompactionMarkFilter

Create a benchmark to show the benefit of adding concurrency
to the no compaction mark filter. Set-up an in-memory bucket
with a simulated (network) delay. In the future we can refactor
this a bit more to test more/all filters.

Fixes: thanos-io#4084
Signed-off-by: Holger Hans Peter Freyther <[email protected]>

* Update pkg/compact/compact_test.go

Co-authored-by: Giedrius Statkevičius <[email protected]>
Signed-off-by: Holger Hans Peter Freyther <[email protected]>

Co-authored-by: Giedrius Statkevičius <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants