Skip to content

Minecraft: Java Edition 26.3 rewritten from scratch in Rust, checked against vanilla with 281 differential harnesses. Get it with the Horizon launcher.

Telemetry: the time to the title is the title's first frame

Ludovic Marie182fbc30e55a
diff --git a/crates/horizon-client-render/src/telemetry.rs b/crates/horizon-client-render/src/telemetry.rs
index 3e7681b6a..d0047a1e7 100644
--- a/crates/horizon-client-render/src/telemetry.rs
+++ b/crates/horizon-client-render/src/telemetry.rs
@@ -20,9 +20,6 @@ const MIN_SECONDS: f32 = 60.0;
const CRASH_DETAILS: [&str; 3] = ["Horizon Version", "Graphics Adapter", "Render Settings"];
static STARTED: OnceLock<Instant> = OnceLock::new();
-/// When the menu bundle became ready, so the time to the title screen measures
-/// the menu and not the world bundle loaded behind it.
-static UI_READY_MS: AtomicU32 = AtomicU32::new(u32::MAX);
static CORE_READY_MS: AtomicU32 = AtomicU32::new(u32::MAX);
static REST_READY_MS: AtomicU32 = AtomicU32::new(u32::MAX);
/// The GPU, once the renderer has its adapter: name, maker, kind, driver, backend, its own memory.
@@ -46,14 +43,6 @@ pub fn mark_start() {
STARTED.get_or_init(Instant::now);
}
-/// The menu bundle is ready: the title screen can draw. The first writer wins.
-pub fn mark_ui_ready() {
- if let Some(started) = STARTED.get() {
- let ms = started.elapsed().as_millis() as u32;
- let _ = UI_READY_MS.compare_exchange(u32::MAX, ms, Ordering::Relaxed, Ordering::Relaxed);
- }
-}
-
pub fn mark_core_ready() {
mark_ready(&CORE_READY_MS);
}
@@ -242,12 +231,9 @@ impl Session {
if !self.title_measured {
self.title_measured = true;
crate::spans::startup::mark("title.shown");
- let ui_ms = UI_READY_MS.load(Ordering::Relaxed);
- self.to_title_ms = if ui_ms != u32::MAX {
- Some(ui_ms)
- } else {
- STARTED.get().map(|s| s.elapsed().as_millis() as u32)
- };
+ // The frame itself: the menu bundle can be ready seconds before
+ // the renderer that draws it (pipelines compiling on a slow driver).
+ self.to_title_ms = STARTED.get().map(|s| s.elapsed().as_millis() as u32);
}
}
diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs
index 3721e78f3..d5f2debd0 100644
--- a/crates/horizon-client/src/game.rs
+++ b/crates/horizon-client/src/game.rs
@@ -19237,7 +19237,6 @@ fn load_resources(
let parallel = threads > 1;
let mut offer = |ui: UiResources, root: &std::path::Path| {
if menu {
- horizon_client::telemetry::mark_ui_ready();
log::info!(
"Horizon: UI bundle ready after {} ms",
started.elapsed().as_millis()