aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Wülker <simon.wuelker@arcor.de>2025-05-15 18:54:02 +0200
committerGitHub <noreply@github.com>2025-05-15 16:54:02 +0000
commitf9382fcaa00206ce1f5f99a9dc417065d980b5ee (patch)
treeae2c5dd31a3a200fdcb86f8d52f84472a21b85ab
parent3af0992ead88ffc33e834bc3a6488554ddf7a544 (diff)
downloadservo-f9382fcaa00206ce1f5f99a9dc417065d980b5ee.tar.gz
servo-f9382fcaa00206ce1f5f99a9dc417065d980b5ee.zip
Remove layout-2013 profiling categories (#37014)
This change also removes the ProfilingCategory::variant_name function, because strum_macros::IntoStaticStr is already being used and does the same thing. Testing: This change compiles and that's good enough Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
-rw-r--r--components/profile/time.rs25
-rw-r--r--components/shared/profile/time.rs25
2 files changed, 3 insertions, 47 deletions
diff --git a/components/profile/time.rs b/components/profile/time.rs
index ce6e6eb90b3..c2a056cfe9c 100644
--- a/components/profile/time.rs
+++ b/components/profile/time.rs
@@ -69,27 +69,6 @@ impl Formattable for Option<TimerMetadata> {
}
}
-impl Formattable for ProfilerCategory {
- // some categories are subcategories of LayoutPerformCategory
- // and should be printed to indicate this
- fn format(&self, _output: &Option<OutputOptions>) -> String {
- let padding = match *self {
- ProfilerCategory::LayoutStyleRecalc |
- ProfilerCategory::LayoutRestyleDamagePropagation |
- ProfilerCategory::LayoutGeneratedContent |
- ProfilerCategory::LayoutFloatPlacementSpeculation |
- ProfilerCategory::LayoutMain |
- ProfilerCategory::LayoutStoreOverflow |
- ProfilerCategory::LayoutDispListBuild |
- ProfilerCategory::LayoutParallelWarmup |
- ProfilerCategory::LayoutTextShaping => "| + ",
- _ => "",
- };
- let name: &'static str = self.into();
- format!("{padding}{name}")
- }
-}
-
type ProfilerBuckets = BTreeMap<(ProfilerCategory, Option<TimerMetadata>), Vec<Duration>>;
// back end of the profiler that handles data aggregation and performance metrics
@@ -276,7 +255,7 @@ impl Profiler {
writeln!(
file,
"{}\t{}\t{:15.4}\t{:15.4}\t{:15.4}\t{:15.4}\t{:15}",
- category.format(&self.output),
+ category.variant_name(),
meta.format(&self.output),
mean.as_seconds_f64() * 1000.,
median.as_seconds_f64() * 1000.,
@@ -319,7 +298,7 @@ impl Profiler {
writeln!(
&mut lock,
"{:-35}{} {:15.4} {:15.4} {:15.4} {:15.4} {:15}",
- category.format(&self.output),
+ category.variant_name(),
meta.format(&self.output),
mean.as_seconds_f64() * 1000.,
median.as_seconds_f64() * 1000.,
diff --git a/components/shared/profile/time.rs b/components/shared/profile/time.rs
index af2aba06662..877d1aaee15 100644
--- a/components/shared/profile/time.rs
+++ b/components/shared/profile/time.rs
@@ -8,7 +8,6 @@ use log::warn;
use malloc_size_of_derive::MallocSizeOf;
use serde::{Deserialize, Serialize};
use servo_config::opts;
-use strum_macros::IntoStaticStr;
use time::Duration;
#[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
@@ -59,9 +58,7 @@ pub enum ProfilerMsg {
/// Usage sites of variants marked “Rust tracing only” are not visible to rust-analyzer.
#[repr(u32)]
-#[derive(
- Clone, Copy, Debug, Deserialize, Eq, Hash, IntoStaticStr, Ord, PartialEq, PartialOrd, Serialize,
-)]
+#[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize)]
pub enum ProfilerCategory {
/// The compositor is rasterising or presenting.
///
@@ -71,17 +68,6 @@ pub enum ProfilerCategory {
/// The script thread is doing layout work.
LayoutPerform = 0x10,
- /// Events currently only used by Layout 2013.
- LayoutStyleRecalc = 0x11,
- LayoutTextShaping = 0x12,
- LayoutRestyleDamagePropagation = 0x13,
- LayoutGeneratedContent = 0x18,
- LayoutFloatPlacementSpeculation = 0x1a,
- LayoutMain = 0x1b,
- LayoutStoreOverflow = 0x1c,
- LayoutParallelWarmup = 0x1d,
- LayoutDispListBuild = 0x1e,
-
ImageSaving = 0x51,
ScriptAttachLayout = 0x60,
ScriptConstellationMsg = 0x61,
@@ -139,15 +125,6 @@ impl ProfilerCategory {
match self {
ProfilerCategory::Compositing => "Compositing",
ProfilerCategory::LayoutPerform => "LayoutPerform",
- ProfilerCategory::LayoutStyleRecalc => "LayoutStyleRecalc",
- ProfilerCategory::LayoutTextShaping => "LayoutTextShaping",
- ProfilerCategory::LayoutRestyleDamagePropagation => "LayoutRestyleDamagePropagation",
- ProfilerCategory::LayoutGeneratedContent => "LayoutGeneratedContent",
- ProfilerCategory::LayoutFloatPlacementSpeculation => "LayoutFloatPlacementSpeculation",
- ProfilerCategory::LayoutMain => "LayoutMain",
- ProfilerCategory::LayoutStoreOverflow => "LayoutStoreOverflow",
- ProfilerCategory::LayoutParallelWarmup => "LayoutParallelWarmup",
- ProfilerCategory::LayoutDispListBuild => "LayoutDispListBuild",
ProfilerCategory::ImageSaving => "ImageSaving",
ProfilerCategory::ScriptAttachLayout => "ScriptAttachLayout",
ProfilerCategory::ScriptConstellationMsg => "ScriptConstellationMsg",