Skip to content

Truly independent web browser

LibWeb: Stop timing each engine computed record installation

Andreas Klinge35effdcf5be
diff --git a/Documentation/Style/StyleEngine.md b/Documentation/Style/StyleEngine.md
index 4939d26d2f0..857c702b203 100644
--- a/Documentation/Style/StyleEngine.md
+++ b/Documentation/Style/StyleEngine.md
@@ -1425,9 +1425,8 @@ Diagnostic transactions still contribute to the Rust ledger, but their returned
bridge durations are not charged to the C++ style-update ledger.
`styleEnginePlanningMicroseconds` remains a compatibility alias for the bridge
-clock. `styleEngineTransactionSetupMicroseconds` is a subset of submission, and
-`styleRecomputeMicroseconds` is a nested diagnostic. Neither is an extra exclusive
-phase. Timing counters never determine which work runs.
+clock. `styleEngineTransactionSetupMicroseconds` is a subset of submission, not an
+extra exclusive phase. Timing counters never determine which work runs.
Physical-work counts distinguish attempted work from accepted output:
diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h
index b2b4bf39950..db96fe3ecef 100644
--- a/Libraries/LibWeb/DOM/Document.h
+++ b/Libraries/LibWeb/DOM/Document.h
@@ -1313,7 +1313,6 @@ public:
u64 style_update_remainder_microseconds { 0 };
u64 relayouts_performed { 0 };
u64 style_update_microseconds { 0 };
- u64 style_recompute_microseconds { 0 };
u64 custom_property_resolutions { 0 };
u64 custom_property_elements { 0 };
// What resolving those declared values actually walked: every entry into computing one
diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp
index 824adff30ef..e7be77b746e 100644
--- a/Libraries/LibWeb/DOM/Element.cpp
+++ b/Libraries/LibWeb/DOM/Element.cpp
@@ -2283,10 +2283,6 @@ CSS::RequiredInvalidationAfterStyleChange Element::apply_engine_computed_style_r
auto old_style_record = style_record_identity();
auto& counters = document().style_invalidation_counters();
auto& style_computer = document().style_computer();
- auto recompute_started_at = MonotonicTime::now();
- ScopeGuard record_recompute_time = [&] {
- counters.style_recompute_microseconds += (MonotonicTime::now() - recompute_started_at).to_microseconds();
- };
++counters.engine_computed_style_records;
// The engine substituted custom properties into the record's winners the way a C++
diff --git a/Libraries/LibWeb/Internals/Internals.cpp b/Libraries/LibWeb/Internals/Internals.cpp
index 44857e5f06c..b340df63352 100644
--- a/Libraries/LibWeb/Internals/Internals.cpp
+++ b/Libraries/LibWeb/Internals/Internals.cpp
@@ -2952,7 +2952,6 @@ GC::Ref<JS::Object> Internals::style_invalidation_counters_object() const
object->define_direct_property("styleUpdateBridgeMicroseconds"_utf16_fly_string, JS::Value(counters.style_update_bridge_microseconds), JS::default_attributes);
object->define_direct_property("styleUpdateApplyMicroseconds"_utf16_fly_string, JS::Value(counters.style_update_apply_microseconds), JS::default_attributes);
object->define_direct_property("styleUpdateRemainderMicroseconds"_utf16_fly_string, JS::Value(counters.style_update_remainder_microseconds), JS::default_attributes);
- object->define_direct_property("styleRecomputeMicroseconds"_utf16_fly_string, JS::Value(counters.style_recompute_microseconds), JS::default_attributes);
object->define_direct_property("customPropertyResolutions"_utf16_fly_string, JS::Value(counters.custom_property_resolutions), JS::default_attributes);
object->define_direct_property("customPropertyElements"_utf16_fly_string, JS::Value(counters.custom_property_elements), JS::default_attributes);
object->define_direct_property("customPropertyValueComputations"_utf16_fly_string, JS::Value(counters.custom_property_value_computations), JS::default_attributes);
diff --git a/Meta/measure-style-amplification.py b/Meta/measure-style-amplification.py
index a7c185b0b8f..ae573815a1e 100755
--- a/Meta/measure-style-amplification.py
+++ b/Meta/measure-style-amplification.py
@@ -252,7 +252,6 @@ def stage_model(sample):
[
"styleEngineTransactionSetupMicroseconds",
"styleEnginePlanningMicroseconds",
- "styleRecomputeMicroseconds",
],
)
return {
@@ -342,7 +341,6 @@ def stage_model(sample):
"style_update": style_update_microseconds,
"transaction_setup": counter(sample, "style", "styleEngineTransactionSetupMicroseconds"),
"planning": counter(sample, "style", "styleEnginePlanningMicroseconds"),
- "style_recompute": counter(sample, "style", "styleRecomputeMicroseconds"),
"cascade": counter(sample, "style", "styleCascadeMicroseconds"),
"computed_values": counter(sample, "style", "styleValuesMicroseconds"),
"accounted_operator_total": accounted_microseconds,