diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index 9221a7485..68bddb643 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -9097,6 +9097,13 @@ impl ApplicationHandler for Game<'_> { } if rendered { self.frame_stats.record(elapsed.as_secs_f32() * 1000.0); + if self.frames == 0 { + // The launcher times Play to this line (launcher/src/perf.rs). + log::info!( + "Horizon: first frame after {} ms", + self.started.elapsed().as_millis() + ); + } if self.title.is_some() { self.perf.title_shown(); } else if self.screen == Screen::Playing && self.player.is_some() { diff --git a/launcher/Cargo.lock b/launcher/Cargo.lock index 427662703..eb76e92f3 100644 --- a/launcher/Cargo.lock +++ b/launcher/Cargo.lock @@ -2629,6 +2629,14 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "horizon-bench" +version = "0.1.0" +dependencies = [ + "serde", + "serde_json", +] + [[package]] name = "horizon-friends" version = "0.1.0" @@ -2654,6 +2662,7 @@ dependencies = [ "futures-lite 2.6.1", "getrandom 0.3.4", "gpui", + "horizon-bench", "horizon-friends", "horizon-prepare", "horizon-theme", diff --git a/launcher/Cargo.toml b/launcher/Cargo.toml index f2c24f429..db7a58150 100644 --- a/launcher/Cargo.toml +++ b/launcher/Cargo.toml @@ -23,6 +23,7 @@ horizon-theme = { path = "../crates/horizon-theme" } horizon-prepare = { path = "../crates/horizon-prepare" } # Join a friend: invite codes (the game does the joining). horizon-friends = { path = "../crates/horizon-friends" } +horizon-bench = { path = "../crates/horizon-bench" } # The session file's random name. getrandom = "0.3" diff --git a/launcher/README.md b/launcher/README.md index cf5b24e4d..9478c6e13 100644 --- a/launcher/README.md +++ b/launcher/README.md @@ -83,9 +83,10 @@ The same binary is a command-line tool; without a subcommand it opens the window horizon-launcher account sign-out horizon-launcher account select play as this account horizon-launcher account offline play without an account + horizon-launcher benchmark [--repeats N] measure the launcher (see Performance log) `--json` prints JSON where there is something to report (`versions`, `install`, `notes`, -`next`, `links`, `menu-style`, `update --check`, `logs`, `account`). Errors go to stderr with exit code 1. `server` runs in the terminal, +`next`, `links`, `menu-style`, `update --check`, `logs`, `account`, `benchmark`). Errors go to stderr with exit code 1. `server` runs in the terminal, so lines you type reach its console. `HORIZON_LAUNCHER_HOME` replaces the data folder (for scripts and tests). @@ -130,6 +131,18 @@ launcher started crashes, the Play page says so, with buttons to open or copy th logs folder and report it on Discord; Settings has the logs folder too. Nothing is ever sent anywhere by itself. +## Performance log + +Each session writes its own measurements to `benchmarks/launcher-