From 2e98f6a18a8977f5a5c567f731370dbb4b2d197c Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sat, 17 Oct 2026 04:25:02 +0200 Subject: [PATCH] Let the behaviour profiler use a snapshot folder Co-Authored-By: Claude Opus 5.5 --- crates/horizon-world/examples/behaviour_load_profile.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crates/horizon-world/examples/behaviour_load_profile.rs b/crates/horizon-world/examples/behaviour_load_profile.rs index e6619afa1..d9d7a1147 100644 --- a/crates/horizon-world/examples/behaviour_load_profile.rs +++ b/crates/horizon-world/examples/behaviour_load_profile.rs @@ -1,4 +1,6 @@ //! Measure registry and behaviour load times using prepared client resources. +//! `behaviour_load_profile RESOURCES [CACHE_DIR]`: with CACHE_DIR, loads use and +//! refresh the snapshot there, as the client does with its `.horizon-cache`. use horizon_world::level::{Behaviours, data::load_registry}; use std::{path::Path, time::Instant}; @@ -7,6 +9,9 @@ fn main() -> Result<(), Box> { .nth(1) .expect("resource directory argument"); let root = Path::new(&root); + if let Some(dir) = std::env::args().nth(2) { + Behaviours::set_cache_dir(dir.into()); + } let started = Instant::now(); let registry = load_registry(root)?; eprintln!(