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

Make (*worker).fetchJob() x3 faster #10

Merged
merged 16 commits into from
Feb 22, 2023

Conversation

vadiminshakov
Copy link

Performance of main worker loop improved (x3). Added interfaces to make worker testable. Old implementations not deleted, just for comparison, see benchmark added.

go test -bench=Benchmark_fetchJob -run=xxx . -cpuprofile=profile.pprof -benchtime=20s

goos: darwin
goarch: amd64
pkg: github.com/sbermarket-tech/work
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Benchmark_fetchJob/old_fetcher-12                  23812            938909 ns/op
Benchmark_fetchJob/new_fetcher-12                  79836            301719 ns/op

@vadiminshakov
Copy link
Author

@aermolaev

@vadiminshakov
Copy link
Author

I deleted all the staff you worry about (nonstd marshaller, bench, interfaces, stubs)

@aermolaev aermolaev merged commit 258415f into Kuper-Tech:master Feb 22, 2023
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.

None yet

2 participants