mirror of
https://github.com/servo/servo.git
synced 2025-06-08 08:33:26 +00:00
Remove measurement of layout query wait time (#33210)
Now that the script thread and the layout thread are the same the wait time effectively zero, so there's no need to measure it. This also removes one dependency and removes one use of legacy time. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
50eb69a7e0
commit
87027d2e5c
5 changed files with 5 additions and 40 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -2851,12 +2851,6 @@ dependencies = [
|
|||
"log",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "histogram"
|
||||
version = "0.6.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "12cb882ccb290b8646e554b157ab0b71e64e8d5bef775cd66b6531e52d302669"
|
||||
|
||||
[[package]]
|
||||
name = "home"
|
||||
version = "0.5.9"
|
||||
|
@ -3766,7 +3760,6 @@ dependencies = [
|
|||
"fonts",
|
||||
"fonts_traits",
|
||||
"fxhash",
|
||||
"histogram",
|
||||
"ipc-channel",
|
||||
"layout_2013",
|
||||
"log",
|
||||
|
@ -3787,7 +3780,6 @@ dependencies = [
|
|||
"servo_url",
|
||||
"style",
|
||||
"style_traits",
|
||||
"time 0.1.45",
|
||||
"url",
|
||||
"webrender_api",
|
||||
"webrender_traits",
|
||||
|
|
|
@ -20,7 +20,6 @@ fnv = { workspace = true }
|
|||
fxhash = { workspace = true }
|
||||
fonts = { path = "../fonts" }
|
||||
fonts_traits = { workspace = true }
|
||||
histogram = "0.6.8"
|
||||
ipc-channel = { workspace = true }
|
||||
layout = { path = "../layout", package = "layout_2013" }
|
||||
log = { workspace = true }
|
||||
|
@ -41,7 +40,6 @@ servo_config = { path = "../config" }
|
|||
servo_url = { path = "../url" }
|
||||
style = { workspace = true }
|
||||
style_traits = { workspace = true }
|
||||
time = { workspace = true }
|
||||
url = { workspace = true }
|
||||
webrender_api = { workspace = true }
|
||||
webrender_traits = { workspace = true }
|
||||
|
|
|
@ -27,7 +27,6 @@ use fonts::{
|
|||
};
|
||||
use fonts_traits::WebFontLoadFinishedCallback;
|
||||
use fxhash::{FxHashMap, FxHashSet};
|
||||
use histogram::Histogram;
|
||||
use ipc_channel::ipc::IpcSender;
|
||||
use layout::construct::ConstructionResult;
|
||||
use layout::context::{LayoutContext, RegisteredPainter, RegisteredPainters};
|
||||
|
@ -175,9 +174,6 @@ pub struct LayoutThread {
|
|||
/// Paint time metrics.
|
||||
paint_time_metrics: PaintTimeMetrics,
|
||||
|
||||
/// The time a layout query has waited before serviced by layout.
|
||||
layout_query_waiting_time: Histogram,
|
||||
|
||||
/// The sizes of all iframes encountered during the last layout operation.
|
||||
last_iframe_sizes: RefCell<FnvHashMap<BrowsingContextId, Size2D<f32, CSSPixel>>>,
|
||||
|
||||
|
@ -470,15 +466,6 @@ impl Layout for LayoutThread {
|
|||
// Drop the root flow explicitly to avoid holding style data, such as
|
||||
// rule nodes. The `Stylist` checks when it is dropped that all rule
|
||||
// nodes have been GCed, so we want drop anyone who holds them first.
|
||||
let waiting_time_min = self.layout_query_waiting_time.minimum().unwrap_or(0);
|
||||
let waiting_time_max = self.layout_query_waiting_time.maximum().unwrap_or(0);
|
||||
let waiting_time_mean = self.layout_query_waiting_time.mean().unwrap_or(0);
|
||||
let waiting_time_stddev = self.layout_query_waiting_time.stddev().unwrap_or(0);
|
||||
debug!(
|
||||
"layout: query waiting time: min: {}, max: {}, mean: {}, standard_deviation: {}",
|
||||
waiting_time_min, waiting_time_max, waiting_time_mean, waiting_time_stddev
|
||||
);
|
||||
|
||||
self.root_flow.borrow_mut().take();
|
||||
}
|
||||
|
||||
|
@ -625,7 +612,6 @@ impl LayoutThread {
|
|||
scroll_offsets: Default::default(),
|
||||
webrender_image_cache: Arc::new(RwLock::new(FnvHashMap::default())),
|
||||
paint_time_metrics,
|
||||
layout_query_waiting_time: Histogram::new(),
|
||||
last_iframe_sizes: Default::default(),
|
||||
debug: opts::get().debug.clone(),
|
||||
nonincremental_layout: opts::get().nonincremental_layout,
|
||||
|
@ -968,14 +954,6 @@ impl LayoutThread {
|
|||
debug!("Number of objects in DOM: {}", data.dom_count);
|
||||
debug!("layout: parallel? {}", self.parallel_flag);
|
||||
|
||||
// Record the time that layout query has been waited.
|
||||
let now = time::precise_time_ns();
|
||||
if let ReflowGoal::LayoutQuery(_, timestamp) = data.reflow_goal {
|
||||
self.layout_query_waiting_time
|
||||
.increment(now - timestamp)
|
||||
.expect("layout: wrong layout query timestamp");
|
||||
};
|
||||
|
||||
let Some(root_element) = document.root_element() else {
|
||||
debug!("layout: No root node: bailing");
|
||||
return;
|
||||
|
|
|
@ -2066,10 +2066,7 @@ impl Window {
|
|||
}
|
||||
|
||||
pub fn layout_reflow(&self, query_msg: QueryMsg) -> bool {
|
||||
self.reflow(
|
||||
ReflowGoal::LayoutQuery(query_msg, time::precise_time_ns()),
|
||||
ReflowReason::Query,
|
||||
)
|
||||
self.reflow(ReflowGoal::LayoutQuery(query_msg), ReflowReason::Query)
|
||||
}
|
||||
|
||||
pub fn resolved_font_style_query(&self, node: &Node, value: String) -> Option<ServoArc<Font>> {
|
||||
|
@ -2732,7 +2729,7 @@ fn debug_reflow_events(id: PipelineId, reflow_goal: &ReflowGoal, reason: &Reflow
|
|||
ReflowGoal::Full => "\tFull",
|
||||
ReflowGoal::TickAnimations => "\tTickAnimations",
|
||||
ReflowGoal::UpdateScrollNode(_) => "\tUpdateScrollNode",
|
||||
ReflowGoal::LayoutQuery(ref query_msg, _) => match *query_msg {
|
||||
ReflowGoal::LayoutQuery(ref query_msg) => match *query_msg {
|
||||
QueryMsg::ContentBox => "\tContentBoxQuery",
|
||||
QueryMsg::ContentBoxes => "\tContentBoxesQuery",
|
||||
QueryMsg::NodesFromPointQuery => "\tNodesFromPointQuery",
|
||||
|
|
|
@ -310,7 +310,7 @@ pub enum QueryMsg {
|
|||
pub enum ReflowGoal {
|
||||
Full,
|
||||
TickAnimations,
|
||||
LayoutQuery(QueryMsg, u64),
|
||||
LayoutQuery(QueryMsg),
|
||||
|
||||
/// Tells layout about a single new scrolling offset from the script. The rest will
|
||||
/// remain untouched and layout won't forward this back to script.
|
||||
|
@ -323,7 +323,7 @@ impl ReflowGoal {
|
|||
pub fn needs_display_list(&self) -> bool {
|
||||
match *self {
|
||||
ReflowGoal::Full | ReflowGoal::TickAnimations | ReflowGoal::UpdateScrollNode(_) => true,
|
||||
ReflowGoal::LayoutQuery(ref querymsg, _) => match *querymsg {
|
||||
ReflowGoal::LayoutQuery(ref querymsg) => match *querymsg {
|
||||
QueryMsg::ElementInnerTextQuery |
|
||||
QueryMsg::InnerWindowDimensionsQuery |
|
||||
QueryMsg::NodesFromPointQuery |
|
||||
|
@ -345,7 +345,7 @@ impl ReflowGoal {
|
|||
pub fn needs_display(&self) -> bool {
|
||||
match *self {
|
||||
ReflowGoal::Full | ReflowGoal::TickAnimations | ReflowGoal::UpdateScrollNode(_) => true,
|
||||
ReflowGoal::LayoutQuery(ref querymsg, _) => match *querymsg {
|
||||
ReflowGoal::LayoutQuery(ref querymsg) => match *querymsg {
|
||||
QueryMsg::NodesFromPointQuery |
|
||||
QueryMsg::TextIndexQuery |
|
||||
QueryMsg::ElementInnerTextQuery => true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue