profiler
This commit is contained in:
parent
52e400ca4b
commit
59c80c66e4
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -4,9 +4,12 @@
|
||||||
|
|
||||||
# These are backup files generated by rustfmt
|
# These are backup files generated by rustfmt
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
|
|
||||||
.devenv*
|
.devenv*
|
||||||
devenv.local.nix
|
devenv.local.nix
|
||||||
|
|
||||||
|
# generated by samply rust profiler
|
||||||
|
profile.json
|
||||||
|
|
||||||
# Added by cargo
|
# Added by cargo
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,9 +37,6 @@ fn main() -> Result<()> {
|
||||||
|
|
||||||
// Create an application.
|
// Create an application.
|
||||||
let mut app = App::new(args);
|
let mut app = App::new(args);
|
||||||
if app.should_quit {
|
|
||||||
println!("{}", app.display());
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start the main loop.
|
// Start the main loop.
|
||||||
while !app.should_quit {
|
while !app.should_quit {
|
||||||
|
|
@ -49,6 +46,9 @@ fn main() -> Result<()> {
|
||||||
app.input(input.trim());
|
app.input(input.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// display app final state
|
||||||
|
println!("{}", app.display());
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@
|
||||||
# env.GREET = "devenv";
|
# env.GREET = "devenv";
|
||||||
|
|
||||||
packages = [
|
packages = [
|
||||||
|
|
||||||
|
# dev tools
|
||||||
|
pkgs.samply # code profiler
|
||||||
|
|
||||||
# for bevy
|
# for bevy
|
||||||
pkgs.alsaLib
|
pkgs.alsaLib
|
||||||
pkgs.udev
|
pkgs.udev
|
||||||
|
|
|
||||||
4
justfile
4
justfile
|
|
@ -10,3 +10,7 @@ runcli:
|
||||||
RUST_LOG=info cargo run --bin=client_cli
|
RUST_LOG=info cargo run --bin=client_cli
|
||||||
runclibots:
|
runclibots:
|
||||||
RUST_LOG=info cargo run --bin=client_cli -- --bot dummy,dummy
|
RUST_LOG=info cargo run --bin=client_cli -- --bot dummy,dummy
|
||||||
|
profile:
|
||||||
|
echo '1' | sudo tee /proc/sys/kernel/perf_event_paranoid
|
||||||
|
cargo build --profile profiling
|
||||||
|
samply record ./target/profiling/client_cli --bot dummy,dummy
|
||||||
|
|
|
||||||
|
|
@ -582,8 +582,6 @@ impl GameState {
|
||||||
/// The reasons why a game could end
|
/// The reasons why a game could end
|
||||||
#[derive(Debug, Clone, Copy, Serialize, PartialEq, Deserialize)]
|
#[derive(Debug, Clone, Copy, Serialize, PartialEq, Deserialize)]
|
||||||
pub enum EndGameReason {
|
pub enum EndGameReason {
|
||||||
// In tic tac toe it doesn't make sense to keep playing when one of the players disconnect.
|
|
||||||
// Note that it might make sense to keep playing in some other game (like Team Fight Tactics for instance).
|
|
||||||
PlayerLeft { player_id: PlayerId },
|
PlayerLeft { player_id: PlayerId },
|
||||||
PlayerWon { winner: PlayerId },
|
PlayerWon { winner: PlayerId },
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue