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

bench(udp): measure non-GSO & GSO on localhost #1915

Merged
merged 2 commits into from
Jul 8, 2024
Merged

Conversation

mxinden
Copy link
Collaborator

@mxinden mxinden commented Jul 5, 2024

This commit adds a basic benchmark, measuring the time to transfer 10 MiB with and without GSO on localhost.

gso_false/throughput    time:   [23.455 ms 25.230 ms 27.004 ms]
                        thrpt:  [370.31 MiB/s 396.35 MiB/s 426.35 MiB/s]

gso_true/throughput     time:   [1.0168 ms 1.1239 ms 1.2496 ms]
                        thrpt:  [7.8153 GiB/s 8.6889 GiB/s 9.6044 GiB/s]
$ cat /proc/cpuinfo
model name      : 12th Gen Intel(R) Core(TM) i9-12900HK

Given various optimizations for localhost traffic on Linux, we were wondering whether GSO actually has an impact on localhost. According to this benchmark: Yes it does.

For what a localhost network benchmark is worth, here it is. Feel free to close in case it isn't useful.

This commit adds a basic benchmark, measuring the time to transfer 10 MiB with
and without GSO on localhost.

```

gso_false/throughput    time:   [23.455 ms 25.230 ms 27.004 ms]
                        thrpt:  [370.31 MiB/s 396.35 MiB/s 426.35 MiB/s]

gso_true/throughput     time:   [1.0168 ms 1.1239 ms 1.2496 ms]
                        thrpt:  [7.8153 GiB/s 8.6889 GiB/s 9.6044 GiB/s]
```

```
$ cat /proc/cpuinfo
model name      : 12th Gen Intel(R) Core(TM) i9-12900HK
```
Copy link
Collaborator

@Ralith Ralith left a comment

Choose a reason for hiding this comment

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

Neat! Seems worth having to me; quinn-udp has some internal logic, so being able to measure the impact of any large changes will help.

Otherwise e.g. FreeBSD complains with:

```
  error[E0601]: `main` function not found in crate `throughput`
    --> quinn-udp/benches/throughput.rs:77:26
     |
  77 | criterion_main!(benches);
     |                          ^ consider adding a `main` function to `quinn-udp/benches/throughput.rs`
```
@djc djc merged commit 36407fe into quinn-rs:main Jul 8, 2024
8 checks passed
flub pushed a commit to n0-computer/quinn that referenced this pull request Aug 6, 2024
This commit adds a basic benchmark, measuring the time to transfer 10
MiB with and without GSO on localhost.

```
gso_false/throughput    time:   [23.455 ms 25.230 ms 27.004 ms]
                        thrpt:  [370.31 MiB/s 396.35 MiB/s 426.35 MiB/s]

gso_true/throughput     time:   [1.0168 ms 1.1239 ms 1.2496 ms]
                        thrpt:  [7.8153 GiB/s 8.6889 GiB/s 9.6044 GiB/s]
```

```
$ cat /proc/cpuinfo
model name      : 12th Gen Intel(R) Core(TM) i9-12900HK
```

---

Given various optimizations for `localhost` traffic on Linux, we were
wondering whether GSO actually has an impact on `localhost`. According
to this benchmark: Yes it does.

For what a `localhost` network benchmark is worth, here it is. Feel free
to close in case it isn't useful.
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.

3 participants