-
Notifications
You must be signed in to change notification settings - Fork 27
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
(feat) added benchmarks for a simple Go installation #191
Conversation
@@ -41,6 +41,13 @@ jobs: | |||
type: unit-test-run-time | |||
command: go test -race -v ./... -count=1 -coverprofile=coverage.out | |||
record: runtime | |||
- name: Benchmark Test |
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.
╰─$ go test -count 2 -bench=. ./... -benchmem|grep "allocs"
145 8069938 ns/op 7360722 B/op 19794 allocs/op
152 8272545 ns/op 7370076 B/op 19794 allocs/op
CoverItUp Report
Commits HistoryUpto Users HistoryUpto |
CoverItUp ReportComparison Table - 7 Types 📉
Commits HistoryUpto Users HistoryUpto |
CoverItUp ReportComparison Table - 7 Types 📉
Commits HistoryUpto Users HistoryUpto |
CoverItUp ReportComparison Table - 7 Types 📉
Commits HistoryUpto Users HistoryUpto |
gobrew_test.go
Outdated
@@ -25,6 +25,17 @@ func setupGobrew(t *testing.T, ts *httptest.Server) GoBrew { | |||
return gb | |||
} | |||
|
|||
func BenchmarkInstallGo(t *testing.B) { | |||
for i := 0; i < t.N; i++ { | |||
ts := httptest.NewServer(http.FileServer(http.Dir("testdata"))) |
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.
why do you include the launch of the web server in the performance test?
in my opinion, this should not be done in a loop, but at the very beginning of the function, after which we should reset the time counter.
in this case, the data will be correct.
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.
Ah. Thanks!!
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.
I think we need to correct the test
CoverItUp ReportComparison Table - 7 Types 📉
Commits HistoryUpto Users HistoryUpto |
Woah, we have a lot of allocs. Thanks to your new mock tests we can now measure them.