adds tracing for instrumenting non-async functions (#44147)

Tracing code is not included in normal release builds
Documents how to use them in our performance docs
Only the maps and cursors are instrumented atm

# Compile times:
current main: fresh release build (cargo clean then build --release)
377.34 secs
current main: fresh debug build (cargo clean then build )
89.31 secs

tracing tracy: fresh release build (cargo clean then build --release)
374.84 secs
tracing tracy: fresh debug build (cargo clean then build )
88.95 secs

tracing tracy: fresh release build with timings (cargo clean then build
--release --features tracing)
375.77 secs
tracing tracy: fresh debug build with timings (cargo clean then build
--features tracing)
90.03 secs


Release Notes:

- N/A

---------

Co-authored-by: localcc <work@localcc.cc>
This commit is contained in:
David Kleingeld
2025-12-05 17:23:06 +00:00
committed by GitHub
co-authored by localcc
parent 07fe8e9bb1
commit b558be7ec6
38 changed files with 898 additions and 451 deletions
@@ -14,6 +14,7 @@ use gpui::{
use language::Buffer;
use text::BufferId;
use util::ResultExt;
use ztracing::instrument;
use crate::{
Project,
@@ -254,6 +255,7 @@ impl BranchDiff {
self.repo.as_ref()
}
#[instrument(skip_all)]
pub fn load_buffers(&mut self, cx: &mut Context<Self>) -> Vec<DiffBuffer> {
let mut output = Vec::default();
let Some(repo) = self.repo.clone() else {
@@ -318,6 +320,7 @@ impl BranchDiff {
output
}
#[instrument(skip_all)]
fn load_buffer(
branch_diff: Option<git::status::TreeDiffStatus>,
project_path: crate::ProjectPath,