mirror of
https://github.com/italicsjenga/valence.git
synced 2024-12-24 23:11:29 +11:00
f58e6662dd
Adds the performance_tests/ directory. In the future we could use our own fake client software instead of rust-mc-bot. This would make it easier to run the tests.
34 lines
1 KiB
Markdown
34 lines
1 KiB
Markdown
# Performance Tests
|
|
|
|
Run the server
|
|
|
|
```shell
|
|
cargo r -r -p players
|
|
```
|
|
|
|
In a separate terminal, start [rust-mc-bot](https://github.com/Eoghanmc22/rust-mc-bot).
|
|
This command should connect 1000 clients to the server.
|
|
|
|
```shell
|
|
cargo r -r -- 127.0.0.1:25565 1000
|
|
|
|
# If rust-mc-bot was cloned in the performance_tests directory, do
|
|
cargo r -r -p rust-mc-bot -- 127.0.0.1:25565 1000
|
|
```
|
|
|
|
If the delta time is consistently >50ms, the server is running behind schedule.
|
|
|
|
# Flamegraph
|
|
|
|
To start capturing a [flamegraph](https://github.com/flamegraph-rs/flamegraph),
|
|
run the server like this:
|
|
|
|
```shell
|
|
CARGO_PROFILE_RELEASE_DEBUG=true cargo flamegraph -p players
|
|
```
|
|
|
|
Run rust-mc-bot as above, and then stop the server after a few seconds. Flamegraph will take its own sweet time to
|
|
generate a flamegraph.svg in the current directory. You can then open that file in your internet browser of choice.
|
|
|
|
NOTE: The indiscriminate use of `rayon` in Valence appears to have made the flamegraph basically unreadable. This
|
|
situation should change soon. |