Skip to content

Conversation

@oleg-jukovec
Copy link
Collaborator

Existing benchmarks are no longer relevant - no one knows what they're testing. Instead, benchmarks have been added for the following metrics:

  • Number of allocations.
  • RPS on synchronous and asynchronous modes.

@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/perf-tests branch 2 times, most recently from 7da7935 to 6008328 Compare October 27, 2025 15:27
Existing benchmarks are no longer relevant - no one knows what they're
testing. Instead, benchmarks have been added for the following
metrics:

* Number of allocations.
* RPS on synchronous and asynchronous modes.
b.Errorf("request error: %s", err)
}

tuple := data[0].([]any)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe GetTyped([][]uint16) will perform better here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It won't work since it is an array of []any actually.

b.Errorf("Failed to replace: %s", err)
}
rps := float64(requests) / duration.Seconds()
fmt.Println("requests :", requests) // nolint
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's use t.Log/t.Logf instead of fmt.Println here.

}
}
}()
_, err := conns[0].Replace(spaceNo, []interface{}{uint(1111), "hello", "world"})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not use deprecated APIs in new/modified benches

// TestPerformance is a benchmark for the async API that is unable to implement
// with a Go-benchmark. It can be used to test performance with different
// numbers of connections and processing goroutines.
func TestBenchmarkAsync(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not strongly agains that kind of "bench", but i'd suggest it to be t.Skip()ped by default, only run it in case of CLI argument is provided.

Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpicking: we can configure this bench using CLI flags too.

// TestPerformance is a benchmark for the async API that is unable to implement
// with a Go-benchmark. It can be used to test performance with different
// numbers of connections and processing goroutines.
func TestBenchmarkAsync(t *testing.T) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'd prefer this test to be separated from usual integration tests (for example - in other file). The same thing applies to usual benches, but again - no prio.

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.

4 participants