logiguard fork v3: full patch set on verified 8c74db0 tree
Includes prior-session patches (carry forward so the app compiles): - crates/gpui/build.rs: cross-compile manifest fix - crates/gpui/src/platform.rs: PlatformWindow::activate_with_token trait method - crates/gpui/src/window.rs: Window::activate_with_token public API - crates/gpui_linux/src/linux/wayland/window.rs: WaylandWindow::activate_with_token + activate() keyboard-serial fix Plus the focus-serial fix: - serial.rs: SerialKind::KeyboardEnter - client.rs: store wl_keyboard.enter serial; latest_serial_of() Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
14
crates/worktree_benchmarks/Cargo.toml
Normal file
14
crates/worktree_benchmarks/Cargo.toml
Normal file
@@ -0,0 +1,14 @@
|
||||
[package]
|
||||
name = "worktree_benchmarks"
|
||||
version = "0.1.0"
|
||||
publish.workspace = true
|
||||
edition.workspace = true
|
||||
|
||||
[dependencies]
|
||||
fs.workspace = true
|
||||
gpui_platform.workspace = true
|
||||
settings.workspace = true
|
||||
worktree.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
1
crates/worktree_benchmarks/LICENSE-GPL
Symbolic link
1
crates/worktree_benchmarks/LICENSE-GPL
Symbolic link
@@ -0,0 +1 @@
|
||||
../../LICENSE-GPL
|
||||
52
crates/worktree_benchmarks/src/main.rs
Normal file
52
crates/worktree_benchmarks/src/main.rs
Normal file
@@ -0,0 +1,52 @@
|
||||
use std::{
|
||||
path::Path,
|
||||
sync::{Arc, atomic::AtomicUsize},
|
||||
};
|
||||
|
||||
use fs::RealFs;
|
||||
use settings::WorktreeId;
|
||||
use worktree::Worktree;
|
||||
|
||||
fn main() {
|
||||
let Some(worktree_root_path) = std::env::args().nth(1) else {
|
||||
println!(
|
||||
"Missing path to worktree root\nUsage: bench_background_scan PATH_TO_WORKTREE_ROOT"
|
||||
);
|
||||
return;
|
||||
};
|
||||
let app = gpui_platform::headless();
|
||||
|
||||
app.run(|cx| {
|
||||
settings::init(cx);
|
||||
let fs = Arc::new(RealFs::new(None, cx.background_executor().clone()));
|
||||
|
||||
cx.spawn(async move |cx| {
|
||||
let worktree = Worktree::local(
|
||||
Path::new(&worktree_root_path),
|
||||
true,
|
||||
fs,
|
||||
Arc::new(AtomicUsize::new(0)),
|
||||
true,
|
||||
WorktreeId::from_proto(0),
|
||||
cx,
|
||||
)
|
||||
.await
|
||||
.expect("Worktree initialization to succeed");
|
||||
let did_finish_scan =
|
||||
worktree.update(cx, |this, _| this.as_local().unwrap().scan_complete());
|
||||
let start = std::time::Instant::now();
|
||||
did_finish_scan.await;
|
||||
let elapsed = start.elapsed();
|
||||
let (files, directories) =
|
||||
worktree.read_with(cx, |this, _| (this.file_count(), this.dir_count()));
|
||||
println!(
|
||||
"{:?} for {directories} directories and {files} files",
|
||||
elapsed
|
||||
);
|
||||
cx.update(|cx| {
|
||||
cx.quit();
|
||||
})
|
||||
})
|
||||
.detach();
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user