test(perf): add macOS Tauri WebView performance harness

Drive the production home traffic graph through embedded WebDriver in an
isolated optimized measurement build. Record attributed WebContent and main
process CPU/RSS distributions across foreground, hidden and restored phases.

Keep replay, raw reports, independent-run comparison, cleanup checks and
focused validation available through project commands. Normal release builds
exclude the automation service and measurement entry points.
This commit is contained in:
Tunglies
2026-09-07 07:13:24 +08:00
parent dd7b032cb1
commit b39c5f9b6d
25 changed files with 5350 additions and 656 deletions
+13 -4
View File
@@ -1,10 +1,19 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use std::{
process::ExitCode,
sync::atomic::{AtomicUsize, Ordering},
};
use std::process::ExitCode;
#[cfg(not(all(feature = "perf-harness", target_os = "macos")))]
use std::sync::atomic::{AtomicUsize, Ordering};
#[cfg(all(feature = "perf-harness", target_os = "macos"))]
#[path = "../../scripts/perf/app.rs"]
mod perf;
#[cfg(all(feature = "perf-harness", target_os = "macos"))]
fn main() -> ExitCode {
perf::run()
}
#[cfg(not(all(feature = "perf-harness", target_os = "macos")))]
fn main() -> ExitCode {
let default_parallelism = std::thread::available_parallelism().map(|n| n.get()).unwrap_or(1);
let worker_limit = std::cmp::min(default_parallelism, 8);