mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-24 06:34:09 +00:00
refactor: update git index refresh to a no-op and change logging level to debug
The `refresh_git_index` function is now a no-op, as the previous implementation added unnecessary latency without meaningful benefits. Additionally, logging levels for performance metrics have been changed from info to debug across various modules to reduce verbosity and improve performance during normal operations.
This commit is contained in:
parent
3666c2a5e1
commit
a2c7968c60
6 changed files with 28 additions and 59 deletions
|
|
@ -145,8 +145,6 @@ pub(crate) fn run_live_syncback(
|
|||
removed
|
||||
);
|
||||
|
||||
crate::git::refresh_git_index(base_path);
|
||||
|
||||
drop(session_old);
|
||||
|
||||
Ok(SyncbackStats { added, removed })
|
||||
|
|
|
|||
|
|
@ -159,14 +159,14 @@ impl SyncbackCommand {
|
|||
let dom_start_timer = Instant::now();
|
||||
let dom_new = read_dom(&path_new, input_kind)?;
|
||||
let dom_elapsed = dom_start_timer.elapsed();
|
||||
log::info!("[PERF] parse rbxl: {:.3}s", dom_elapsed.as_secs_f64());
|
||||
log::debug!("[PERF] parse rbxl: {:.3}s", dom_elapsed.as_secs_f64());
|
||||
|
||||
let vfs = Vfs::new_oneshot();
|
||||
|
||||
let project_start_timer = Instant::now();
|
||||
let mut session_old = ServeSession::new_oneshot(vfs, path_old.clone())?;
|
||||
let project_elapsed = project_start_timer.elapsed();
|
||||
log::info!(
|
||||
log::debug!(
|
||||
"[PERF] init old tree (prefetch+snapshot+patch): {:.3}s",
|
||||
project_elapsed.as_secs_f64()
|
||||
);
|
||||
|
|
@ -205,7 +205,7 @@ impl SyncbackCommand {
|
|||
pre_walked_paths,
|
||||
)?;
|
||||
let syncback_elapsed = syncback_timer.elapsed();
|
||||
log::info!(
|
||||
log::debug!(
|
||||
"[PERF] syncback_loop total: {:.3}s",
|
||||
syncback_elapsed.as_secs_f64()
|
||||
);
|
||||
|
|
@ -239,7 +239,7 @@ impl SyncbackCommand {
|
|||
|
||||
let git_cache_timer = Instant::now();
|
||||
let git_cache = crate::git::GitIndexCache::new(base_path);
|
||||
log::info!(
|
||||
log::debug!(
|
||||
"[PERF] git index cache build: {:.3}s (entries: {})",
|
||||
git_cache_timer.elapsed().as_secs_f64(),
|
||||
git_cache.as_ref().map_or(0, |c| c.len()),
|
||||
|
|
@ -286,7 +286,7 @@ impl SyncbackCommand {
|
|||
git_cache.as_ref(),
|
||||
)?;
|
||||
}
|
||||
log::info!(
|
||||
log::debug!(
|
||||
"[PERF] write_to_vfs_parallel: {:.3}s",
|
||||
write_timer.elapsed().as_secs_f64()
|
||||
);
|
||||
|
|
@ -297,13 +297,6 @@ impl SyncbackCommand {
|
|||
result.fs_snapshot.removed_paths().len()
|
||||
);
|
||||
|
||||
let git_refresh_timer = Instant::now();
|
||||
crate::git::refresh_git_index(base_path);
|
||||
log::info!(
|
||||
"[PERF] git refresh_index: {:.3}s",
|
||||
git_refresh_timer.elapsed().as_secs_f64()
|
||||
);
|
||||
|
||||
// Delete input file if using default Project.rbxl location
|
||||
if let Some(input_path) = &delete_input_after_syncback {
|
||||
match std::fs::remove_file(input_path) {
|
||||
|
|
@ -324,7 +317,7 @@ impl SyncbackCommand {
|
|||
log::info!("Aborting before writing to file system due to `--dry-run`");
|
||||
}
|
||||
|
||||
log::info!(
|
||||
log::debug!(
|
||||
"[PERF] TOTAL syncback command: {:.3}s",
|
||||
total_timer.elapsed().as_secs_f64()
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue