mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
tools: Improve instrumentation and add it for some layout (#33647)
Improves the instrumentation to skip all function arguments and also add spans for some layout modes. This is preparation for improving the performance of flexbox. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
20eb927843
commit
719b5aba24
8 changed files with 140 additions and 115 deletions
|
@ -19,6 +19,7 @@ use style::values::generics::flex::GenericFlexBasis as FlexBasis;
|
|||
use style::values::generics::length::{GenericLengthPercentageOrAuto, LengthPercentageOrNormal};
|
||||
use style::values::specified::align::AlignFlags;
|
||||
use style::Zero;
|
||||
use tracing::instrument;
|
||||
|
||||
use super::geom::{FlexAxis, FlexRelativeRect, FlexRelativeSides, FlexRelativeVec2};
|
||||
use super::{FlexContainer, FlexContainerConfig, FlexItemBox, FlexLevelBox};
|
||||
|
@ -338,6 +339,11 @@ struct FlexItemBoxInlineContentSizesInfo {
|
|||
}
|
||||
|
||||
impl FlexContainer {
|
||||
#[instrument(
|
||||
name = "FlexContainer::inline_content_sizes",
|
||||
skip_all,
|
||||
fields(servo_profiling = true)
|
||||
)]
|
||||
pub fn inline_content_sizes(
|
||||
&mut self,
|
||||
layout_context: &LayoutContext,
|
||||
|
@ -531,6 +537,11 @@ impl FlexContainer {
|
|||
}
|
||||
|
||||
/// <https://drafts.csswg.org/css-flexbox/#layout-algorithm>
|
||||
#[instrument(
|
||||
name = "FlexContainer::layout",
|
||||
skip_all,
|
||||
fields(servo_profiling = true)
|
||||
)]
|
||||
pub(crate) fn layout(
|
||||
&self,
|
||||
layout_context: &LayoutContext,
|
||||
|
@ -2461,6 +2472,11 @@ impl FlexItemBox {
|
|||
}
|
||||
|
||||
#[allow(clippy::too_many_arguments)]
|
||||
#[instrument(
|
||||
name = "FlexContainer::layout_for_block_content_size",
|
||||
skip_all,
|
||||
fields(servo_profiling = true)
|
||||
)]
|
||||
fn layout_for_block_content_size(
|
||||
&mut self,
|
||||
flex_context: &FlexContext,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue