diff options
| author | Laurenz <laurmaedje@gmail.com> | 2023-05-11 11:35:45 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2023-05-11 11:35:45 +0200 |
| commit | 998a3c44fd79eac92c375ec9e755288bc146a279 (patch) | |
| tree | 70825f2d68ed64c32b8b2551dcf0e545753f643c /library | |
| parent | 2f0b5eeae09bd880e4552bb83e44d9cd32571c58 (diff) | |
Remove tracing from cheap functions
Turns out that having tracing enabled on some functions that get called a lot distorts the traces so that their parent stack frames look much more expensive than they actually are.
Diffstat (limited to 'library')
| -rw-r--r-- | library/src/layout/grid.rs | 2 | ||||
| -rw-r--r-- | library/src/layout/mod.rs | 8 |
2 files changed, 3 insertions, 7 deletions
diff --git a/library/src/layout/grid.rs b/library/src/layout/grid.rs index acfee8a2..1e4bf40b 100644 --- a/library/src/layout/grid.rs +++ b/library/src/layout/grid.rs @@ -290,7 +290,6 @@ impl<'a, 'v> GridLayouter<'a, 'v> { } /// Determines the columns sizes and then layouts the grid row-by-row. - #[tracing::instrument(name = "grid layout", skip(self))] pub fn layout(mut self) -> SourceResult<GridLayout> { self.measure_columns()?; @@ -318,6 +317,7 @@ impl<'a, 'v> GridLayouter<'a, 'v> { } /// Determine all column sizes. + #[tracing::instrument(name = "GridLayouter::measure_columns", skip_all)] fn measure_columns(&mut self) -> SourceResult<()> { // Sum of sizes of resolved relative tracks. let mut rel = Abs::zero(); diff --git a/library/src/layout/mod.rs b/library/src/layout/mod.rs index 16ac46bb..92e36b58 100644 --- a/library/src/layout/mod.rs +++ b/library/src/layout/mod.rs @@ -116,6 +116,7 @@ pub trait Layout { /// /// This element must be layouted again in the same order for the results to /// be valid. + #[tracing::instrument(name = "Layout::measure", skip_all)] fn measure( &self, vt: &mut Vt, @@ -198,6 +199,7 @@ fn realize_root<'a>( } /// Realize into an element that is capable of block-level layout. +#[tracing::instrument(skip_all)] fn realize_block<'a>( vt: &mut Vt, scratch: &'a Scratch<'a>, @@ -261,7 +263,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { } } - #[tracing::instrument(skip_all)] fn accept( &mut self, mut content: &'a Content, @@ -327,7 +328,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { } } - #[tracing::instrument(skip_all)] fn styled( &mut self, elem: &'a Content, @@ -342,7 +342,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { Ok(()) } - #[tracing::instrument(skip(self, local, outer))] fn interrupt_style( &mut self, local: &Styles, @@ -377,7 +376,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { Ok(()) } - #[tracing::instrument(skip(self))] fn interrupt_list(&mut self) -> SourceResult<()> { if !self.list.items.is_empty() { let staged = mem::take(&mut self.list.staged); @@ -391,7 +389,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { Ok(()) } - #[tracing::instrument(skip(self))] fn interrupt_par(&mut self) -> SourceResult<()> { self.interrupt_list()?; if !self.par.0.is_empty() { @@ -403,7 +400,6 @@ impl<'a, 'v, 't> Builder<'a, 'v, 't> { Ok(()) } - #[tracing::instrument(skip_all)] fn interrupt_page(&mut self, styles: Option<StyleChain<'a>>) -> SourceResult<()> { self.interrupt_par()?; let Some(doc) = &mut self.doc else { return Ok(()) }; |
