valence/performance_tests
Ryan Johnson 4226201fed
Replace log crate with tracing (#157)
The `tracing` crate seems to be the go-to
logging/profiling/instrumentation solution nowadays. Perhaps in the
future we could use `tracing` for profiling instead of (or in addition
to) the `perf`-based `cargo flamegraph` command. This would sidestep the
issue of `rayon` polluting the output. I conducted an initial experiment
by adding some more spans but wasn't very happy with the result.

Log messages have also been improved. There is some additional context
and events are raised when clients are added/removed from the server.
2022-11-16 18:22:44 -08:00
..
players Replace log crate with tracing (#157) 2022-11-16 18:22:44 -08:00
README.md Redesign packet processing and improve Client update procedure. (#146) 2022-11-01 03:11:51 -07:00

Performance Tests

Run the server

cargo r -r -p players

In a separate terminal, start rust-mc-bot. This command should connect 1000 clients to the server.

# In the rust-mc-bot directory
cargo r -r -- 127.0.0.1:25565 1000

If the delta time is consistently >50ms, the server is running behind schedule.

Note:

Flamegraph

To start capturing a flamegraph, run the server like this:

# You can also try setting the `CARGO_PROFILE_RELEASE_DEBUG` environment variable to `true`.
cargo flamegraph -p players

Run rust-mc-bot as above, and then stop the server after a few seconds. Flamegraph will generate a flamegraph.svg in the current directory. You can then open that file in your internet browser of choice.