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

test(benchmark): add queue performance check #72

Merged
merged 4 commits into from
May 29, 2022
Merged

test(benchmark): add queue performance check #72

merged 4 commits into from
May 29, 2022

Conversation

appleboy
Copy link
Member

@appleboy appleboy commented May 29, 2022

Before

49894bf

goos: linux
goarch: amd64
pkg: github.com/golang-queue/queue
cpu: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
BenchmarkQueueTask
INFO: 2022/05/29 04:18:27 logger.go:35: shutdown all tasks: 5 workers
BenchmarkQueueTask-2   	     584	   2079968 ns/op	    1801 B/op	      30 allocs/op
BenchmarkQueue
INFO: 2022/05/29 04:18:28 logger.go:35: shutdown all tasks: 5 workers
INFO: 2022/05/29 04:18:28 logger.go:35: shutdown all tasks: 5 workers
INFO: 2022/05/29 04:18:29 logger.go:35: shutdown all tasks: 5 workers
BenchmarkQueue-2       	 1892185	       624.9 ns/op	     214 B/op	       5 allocs/op
PASS
ok  	github.com/golang-queue/queue	2.924s

5d2819e

goos: linux
goarch: amd64
pkg: github.com/golang-queue/queue
cpu: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
BenchmarkQueueTask
BenchmarkQueueTask-2   	     582	   2055769 ns/op	    1403 B/op	      22 allocs/op
BenchmarkQueue
INFO: 2022/05/29 06:47:35 logger.go:35: shutdown all tasks: 4 workers
INFO: 2022/05/29 06:47:36 logger.go:35: shutdown all tasks: 5 workers
INFO: 2022/05/29 06:47:37 logger.go:35: shutdown all tasks: 4 workers
BenchmarkQueue-2       	 1996585	       616.1 ns/op	     212 B/op	       5 allocs/op
PASS
ok  	github.com/golang-queue/queue	2.932s

15c43ec remove wait time in benchmark

After

goos: linux
goarch: amd64
pkg: github.com/golang-queue/queue
cpu: Intel(R) Xeon(R) Platinum 8370C CPU @ 2.80GHz
BenchmarkQueueTask
INFO: 2022/05/29 14:53:36 logger.go:35: shutdown all tasks: 5 workers
INFO: 2022/05/29 14:53:36 logger.go:35: shutdown all tasks: 4 workers
INFO: 2022/05/29 14:53:37 logger.go:35: shutdown all tasks: 5 workers
INFO: 2022/05/29 14:53:38 logger.go:35: shutdown all tasks: 5 workers
BenchmarkQueueTask-2   	14850574	        86.25 ns/op	      54 B/op	       1 allocs/op
BenchmarkQueue
INFO: 2022/05/29 14:53:38 logger.go:35: shutdown all tasks: 5 workers
INFO: 2022/05/29 14:53:38 logger.go:35: shutdown all tasks: 5 workers
INFO: 2022/05/29 14:53:39 logger.go:35: shutdown all tasks: 5 workers
INFO: 2022/05/29 14:53:40 logger.go:35: shutdown all tasks: 5 workers
BenchmarkQueue-2       	 2270523	       484.3 ns/op	     191 B/op	       4 allocs/op
PASS
ok  	github.com/golang-queue/queue	3.738s

@codecov-commenter
Copy link

codecov-commenter commented May 29, 2022

Codecov Report

Merging #72 (15c43ec) into master (b3dd500) will decrease coverage by 0.80%.
The diff coverage is 85.00%.

@@            Coverage Diff             @@
##           master      #72      +/-   ##
==========================================
- Coverage   88.65%   87.85%   -0.81%     
==========================================
  Files           9        9              
  Lines         432      428       -4     
==========================================
- Hits          383      376       -7     
- Misses         44       46       +2     
- Partials        5        6       +1     
Flag Coverage Δ
go-1.13 87.85% <85.00%> (-0.81%) ⬇️
go-1.14 87.85% <85.00%> (+0.11%) ⬆️
go-1.15 86.91% <85.00%> (-0.82%) ⬇️
go-1.16 86.91% <85.00%> (-1.75%) ⬇️
go-1.17 86.91% <85.00%> (-1.75%) ⬇️
go-1.18 86.91% <85.00%> (-1.75%) ⬇️
ubuntu-latest 87.85% <85.00%> (-0.81%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
queue.go 93.49% <80.00%> (-1.84%) ⬇️
consumer.go 84.53% <100.00%> (-0.32%) ⬇️
worker_task.go 90.47% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b3dd500...15c43ec. Read the comment docs.

Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@appleboy appleboy added the enhancement New feature or request label May 29, 2022
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
@appleboy appleboy merged commit c420418 into master May 29, 2022
@appleboy appleboy deleted the benchmark branch May 29, 2022 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants