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

benchmark: PR 5109 (durationcheck) #33

Closed
ldez opened this issue Nov 7, 2024 · 1 comment
Closed

benchmark: PR 5109 (durationcheck) #33

ldez opened this issue Nov 7, 2024 · 1 comment

Comments

@ldez
Copy link
Owner

ldez commented Nov 7, 2024

{
"pr": 5109,
"linter": "durationcheck",
"version": "v1.61.0"
}

Copy link

github-actions bot commented Nov 7, 2024

The benchmark (Benchmark PR (updated linter)) is done!

beego/beego

Command Mean [ms] Min [ms] Max [ms] Relative
local 857.9 ± 70.6 818.4 1049.8 1.08 ± 0.09
v1.61.0 797.6 ± 6.2 788.9 805.6 1.00

cilium/cilium

local
test/helpers/utils.go:83:13: Multiplication of durations: `delay * time.Second` (durationcheck)
	time.Sleep(delay * time.Second)
	           ^
v1.61.0
test/helpers/utils.go:83:13: Multiplication of durations: `delay * time.Second` (durationcheck)
	time.Sleep(delay * time.Second)
	           ^
Command Mean [s] Min [s] Max [s] Relative
local 5.918 ± 0.058 5.829 6.022 1.02 ± 0.01
v1.61.0 5.829 ± 0.051 5.723 5.902 1.00

spf13/cobra

Command Mean [ms] Min [ms] Max [ms] Relative
local 327.8 ± 8.2 317.0 338.7 1.11 ± 0.04
v1.61.0 295.6 ± 6.1 285.8 306.8 1.00

hashicorp/consul

local
agent/structs/structs.go:2817:10: Multiplication of durations: `dur * time.Second` (durationcheck)
			dur = dur * time.Second
			      ^
lib/retry/retry_test.go:64:21: Multiplication of durations: `expected * time.Second` (durationcheck)
			require.Equal(t, expected*time.Second, w.delay(), "failure count: %d", i)
			                 ^
lib/retry/retry_test.go:72:21: Multiplication of durations: `expected * time.Second` (durationcheck)
			require.Equal(t, expected*time.Second, w.delay(), "failure count: %d", i)
			                 ^
lib/retry/retry_test.go:80:21: Multiplication of durations: `expected * time.Second` (durationcheck)
			require.Equal(t, expected*time.Second, w.delay(), "failure count: %d", i)
			                 ^
lib/retry/retry_test.go:88:21: Multiplication of durations: `expected * time.Second` (durationcheck)
			require.Equal(t, expected*time.Second, w.delay(), "failure count: %d", i)
			                 ^
lib/retry/retry_test.go:96:21: Multiplication of durations: `expected * time.Millisecond` (durationcheck)
			require.Equal(t, expected*time.Millisecond, w.delay(), "failure count: %d", i)
			                 ^
lib/retry/retry_test.go:109:21: Multiplication of durations: `expected * time.Millisecond` (durationcheck)
			require.Equal(t, expected*time.Millisecond, w.delay(), "failure count: %d", i)
			                 ^
v1.61.0
agent/structs/structs.go:2817:10: Multiplication of durations: `dur * time.Second` (durationcheck)
			dur = dur * time.Second
			      ^
lib/retry/retry_test.go:64:21: Multiplication of durations: `expected * time.Second` (durationcheck)
			require.Equal(t, expected*time.Second, w.delay(), "failure count: %d", i)
			                 ^
lib/retry/retry_test.go:72:21: Multiplication of durations: `expected * time.Second` (durationcheck)
			require.Equal(t, expected*time.Second, w.delay(), "failure count: %d", i)
			                 ^
lib/retry/retry_test.go:80:21: Multiplication of durations: `expected * time.Second` (durationcheck)
			require.Equal(t, expected*time.Second, w.delay(), "failure count: %d", i)
			                 ^
lib/retry/retry_test.go:88:21: Multiplication of durations: `expected * time.Second` (durationcheck)
			require.Equal(t, expected*time.Second, w.delay(), "failure count: %d", i)
			                 ^
lib/retry/retry_test.go:96:21: Multiplication of durations: `expected * time.Millisecond` (durationcheck)
			require.Equal(t, expected*time.Millisecond, w.delay(), "failure count: %d", i)
			                 ^
lib/retry/retry_test.go:109:21: Multiplication of durations: `expected * time.Millisecond` (durationcheck)
			require.Equal(t, expected*time.Millisecond, w.delay(), "failure count: %d", i)
			                 ^
Command Mean [s] Min [s] Max [s] Relative
local 4.761 ± 0.133 4.641 5.123 1.01 ± 0.04
v1.61.0 4.729 ± 0.107 4.637 5.014 1.00

go-delve/delve

local
pkg/proc/variables.go:2589:32: Multiplication of durations: `(time.Duration(^uint64(0)>>1) / time.Second) * time.Second` (durationcheck)
	maxAddSeconds time.Duration = (time.Duration(^uint64(0)>>1) / time.Second) * time.Second // maximum number of seconds that can be added with (time.Time).Add, measured in nanoseconds
	                              ^
service/test/integration1_test.go:1027:15: Multiplication of durations: `d * time.Second` (durationcheck)
			time.Sleep(d * time.Second)
			           ^
service/test/integration2_test.go:1631:15: Multiplication of durations: `d * time.Second` (durationcheck)
			time.Sleep(d * time.Second)
			           ^
v1.61.0
pkg/proc/variables.go:2589:32: Multiplication of durations: `(time.Duration(^uint64(0)>>1) / time.Second) * time.Second` (durationcheck)
	maxAddSeconds time.Duration = (time.Duration(^uint64(0)>>1) / time.Second) * time.Second // maximum number of seconds that can be added with (time.Time).Add, measured in nanoseconds
	                              ^
service/test/integration1_test.go:1027:15: Multiplication of durations: `d * time.Second` (durationcheck)
			time.Sleep(d * time.Second)
			           ^
service/test/integration2_test.go:1631:15: Multiplication of durations: `d * time.Second` (durationcheck)
			time.Sleep(d * time.Second)
			           ^
Command Mean [ms] Min [ms] Max [ms] Relative
local 895.0 ± 9.3 880.3 907.3 1.03 ± 0.02
v1.61.0 866.6 ± 16.7 832.8 888.8 1.00

etcd-io/etcd

Command Mean [ms] Min [ms] Max [ms] Relative
local 553.1 ± 19.5 537.9 606.4 1.08 ± 0.04
v1.61.0 510.9 ± 6.5 497.2 518.2 1.00

go-gitea/gitea

Command Mean [s] Min [s] Max [s] Relative
local 3.489 ± 0.043 3.454 3.605 1.02 ± 0.01
v1.61.0 3.432 ± 0.016 3.409 3.460 1.00

google/go-github

Command Mean [s] Min [s] Max [s] Relative
local 1.649 ± 0.042 1.607 1.756 1.03 ± 0.04
v1.61.0 1.604 ± 0.038 1.567 1.692 1.00

golangci/golangci-lint

Command Mean [s] Min [s] Max [s] Relative
local 1.045 ± 0.044 1.007 1.168 1.04 ± 0.07
v1.61.0 1.009 ± 0.055 0.953 1.145 1.00

goreleaser/goreleaser

Command Mean [s] Min [s] Max [s] Relative
local 1.571 ± 0.062 1.522 1.741 1.03 ± 0.06
v1.61.0 1.524 ± 0.067 1.474 1.704 1.00

grpc/grpc-go

Command Mean [s] Min [s] Max [s] Relative
local 1.567 ± 0.016 1.532 1.584 1.03 ± 0.02
v1.61.0 1.526 ± 0.019 1.499 1.553 1.00

gohugoio/hugo

local
lazy/init.go:134:14: Multiplication of durations: `counter * time.Microsecond` (durationcheck)
		time.Sleep(counter * time.Microsecond)
		           ^
v1.61.0
lazy/init.go:134:14: Multiplication of durations: `counter * time.Microsecond` (durationcheck)
		time.Sleep(counter * time.Microsecond)
		           ^
Command Mean [s] Min [s] Max [s] Relative
local 2.200 ± 0.026 2.171 2.261 1.02 ± 0.03
v1.61.0 2.167 ± 0.052 2.126 2.308 1.00

kubernetes/kubernetes

local
pkg/controller/podautoscaler/horizontal_test.go:3933:34: Multiplication of durations: `-time.Second * segmentBoundary` (durationcheck)
			timestamp:     time.Now().Add(-time.Second * segmentBoundary),
			                              ^
pkg/controller/tainteviction/taint_eviction.go:120:49: Multiplication of durations: `time.Since(fireAt) * time.Second` (durationcheck)
				metrics.PodDeletionsLatency.Observe(float64(time.Since(fireAt) * time.Second))
				                                            ^
plugin/pkg/admission/imagepolicy/config_test.go:40:19: Multiplication of durations: `((minAllowTTL + maxAllowTTL) / 2) / time.Second * time.Second` (durationcheck)
				AllowTTL:     ((minAllowTTL + maxAllowTTL) / 2) / time.Second * time.Second,
				              ^
plugin/pkg/admission/imagepolicy/config_test.go:41:19: Multiplication of durations: `((minDenyTTL + maxDenyTTL) / 2) / time.Second * time.Second` (durationcheck)
				DenyTTL:      ((minDenyTTL + maxDenyTTL) / 2) / time.Second * time.Second,
				              ^
plugin/pkg/admission/imagepolicy/config_test.go:102:19: Multiplication of durations: `minRetryBackoff * time.Millisecond` (durationcheck)
				RetryBackoff: minRetryBackoff * time.Millisecond,
				              ^
v1.61.0
pkg/controller/podautoscaler/horizontal_test.go:3933:34: Multiplication of durations: `-time.Second * segmentBoundary` (durationcheck)
			timestamp:     time.Now().Add(-time.Second * segmentBoundary),
			                              ^
pkg/controller/tainteviction/taint_eviction.go:120:49: Multiplication of durations: `time.Since(fireAt) * time.Second` (durationcheck)
				metrics.PodDeletionsLatency.Observe(float64(time.Since(fireAt) * time.Second))
				                                            ^
plugin/pkg/admission/imagepolicy/config_test.go:40:19: Multiplication of durations: `((minAllowTTL + maxAllowTTL) / 2) / time.Second * time.Second` (durationcheck)
				AllowTTL:     ((minAllowTTL + maxAllowTTL) / 2) / time.Second * time.Second,
				              ^
plugin/pkg/admission/imagepolicy/config_test.go:41:19: Multiplication of durations: `((minDenyTTL + maxDenyTTL) / 2) / time.Second * time.Second` (durationcheck)
				DenyTTL:      ((minDenyTTL + maxDenyTTL) / 2) / time.Second * time.Second,
				              ^
plugin/pkg/admission/imagepolicy/config_test.go:102:19: Multiplication of durations: `minRetryBackoff * time.Millisecond` (durationcheck)
				RetryBackoff: minRetryBackoff * time.Millisecond,
				              ^
Command Mean [s] Min [s] Max [s] Relative
local 9.567 ± 0.113 9.451 9.837 1.01 ± 0.01
v1.61.0 9.459 ± 0.075 9.380 9.615 1.00

go-acme/lego

Command Mean [s] Min [s] Max [s] Relative
local 1.925 ± 0.031 1.884 1.995 1.03 ± 0.02
v1.61.0 1.869 ± 0.021 1.834 1.895 1.00

pact-foundation/pact-go

Command Mean [ms] Min [ms] Max [ms] Relative
local 453.6 ± 32.8 428.0 535.5 1.11 ± 0.08
v1.61.0 407.1 ± 5.9 398.8 420.1 1.00

rclone/rclone

local
fs/parseduration_test.go:139:10: Multiplication of durations: `time.Duration(DurationOff) / time.Millisecond * time.Millisecond` (durationcheck)
		{true, time.Duration(DurationOff) / time.Millisecond * time.Millisecond, "292y24w3d23h47m16s853ms", "292y24w3d"}, // Should have been 854ms but some precision are lost with floating point calculations
		       ^
fs/accounting/stats_test.go:48:55: Multiplication of durations: `(time.Duration((1<<63)-1) / time.Second) * time.Second` (durationcheck)
		{size: 0, total: (1 << 63) - 1, rate: 1.0, wantETA: (time.Duration((1<<63)-1) / time.Second) * time.Second, wantOK: true, wantString: "-"},
		                                                    ^
fs/accounting/stats_test.go:49:78: Multiplication of durations: `(time.Duration((1<<63)-1) / time.Second) * time.Second` (durationcheck)
		{size: 0, total: ((1 << 63) - 1) / int64(time.Second), rate: 1.0, wantETA: (time.Duration((1<<63)-1) / time.Second) * time.Second, wantOK: true, wantString: "-"},
		                                                                           ^
fs/accounting/stats_test.go:50:76: Multiplication of durations: `(time.Duration((1<<63)-1)/time.Second - 1) * time.Second` (durationcheck)
		{size: 0, total: ((1<<63)-1)/int64(time.Second) - 1, rate: 1.0, wantETA: (time.Duration((1<<63)-1)/time.Second - 1) * time.Second, wantOK: true, wantString: "292y24w3d"}, // Short format, if full it would be "292y24w3d23h47m15s"
		                                                                         ^
fs/accounting/stats_test.go:51:76: Multiplication of durations: `(time.Duration((1<<63)-1) / time.Second) * time.Second` (durationcheck)
		{size: 0, total: ((1<<63)-1)/int64(time.Second) - 1, rate: 0.1, wantETA: (time.Duration((1<<63)-1) / time.Second) * time.Second, wantOK: true, wantString: "-"},
		                                                                         ^
v1.61.0
fs/parseduration_test.go:139:10: Multiplication of durations: `time.Duration(DurationOff) / time.Millisecond * time.Millisecond` (durationcheck)
		{true, time.Duration(DurationOff) / time.Millisecond * time.Millisecond, "292y24w3d23h47m16s853ms", "292y24w3d"}, // Should have been 854ms but some precision are lost with floating point calculations
		       ^
fs/accounting/stats_test.go:48:55: Multiplication of durations: `(time.Duration((1<<63)-1) / time.Second) * time.Second` (durationcheck)
		{size: 0, total: (1 << 63) - 1, rate: 1.0, wantETA: (time.Duration((1<<63)-1) / time.Second) * time.Second, wantOK: true, wantString: "-"},
		                                                    ^
fs/accounting/stats_test.go:49:78: Multiplication of durations: `(time.Duration((1<<63)-1) / time.Second) * time.Second` (durationcheck)
		{size: 0, total: ((1 << 63) - 1) / int64(time.Second), rate: 1.0, wantETA: (time.Duration((1<<63)-1) / time.Second) * time.Second, wantOK: true, wantString: "-"},
		                                                                           ^
fs/accounting/stats_test.go:50:76: Multiplication of durations: `(time.Duration((1<<63)-1)/time.Second - 1) * time.Second` (durationcheck)
		{size: 0, total: ((1<<63)-1)/int64(time.Second) - 1, rate: 1.0, wantETA: (time.Duration((1<<63)-1)/time.Second - 1) * time.Second, wantOK: true, wantString: "292y24w3d"}, // Short format, if full it would be "292y24w3d23h47m15s"
		                                                                         ^
fs/accounting/stats_test.go:51:76: Multiplication of durations: `(time.Duration((1<<63)-1) / time.Second) * time.Second` (durationcheck)
		{size: 0, total: ((1<<63)-1)/int64(time.Second) - 1, rate: 0.1, wantETA: (time.Duration((1<<63)-1) / time.Second) * time.Second, wantOK: true, wantString: "-"},
		                                                                         ^
Command Mean [s] Min [s] Max [s] Relative
local 2.231 ± 0.058 2.138 2.350 1.03 ± 0.03
v1.61.0 2.168 ± 0.029 2.123 2.207 1.00

hashicorp/terraform

Command Mean [s] Min [s] Max [s] Relative
local 3.116 ± 0.064 3.063 3.263 1.02 ± 0.02
v1.61.0 3.067 ± 0.029 3.025 3.101 1.00

traefik/traefik

Command Mean [s] Min [s] Max [s] Relative
local 3.155 ± 0.056 3.060 3.256 1.04 ± 0.02
v1.61.0 3.045 ± 0.043 2.967 3.098 1.00

You can find the workflow here:
https://github.com/ldez/golangci-lint-bench/actions/runs/11714436550

@ldez ldez closed this as completed Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant