aboutsummaryrefslogtreecommitdiffstats
path: root/components/metrics/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* Made MAX_TASK_NS u128. Also removed a superfluous into(). Both were required ↵Moritz Mœller2025-03-271-1/+1
| | | | | to fix #36122 with nightly 1.85.0 (4d91de4e4 2025-02-17). (#36169) Signed-off-by: Moritz Moeller <virtualritz@protonmail.com>
* metrics: Simplify `ProgressiveWebMetrics` (#35985)Martin Robinson2025-03-211-186/+169
| | | | | | | | | | | | | | | | Simply how `ProgressiveWebMetrics` works: 1. Keep only a single struct instead of one in layout and one script that both implement the `ProgressiveWebMetrics` trait. Since layout and script are the same thread these can now just be a single `ProgressiveWebMetrics` struct stored in script. 2. Have the compositor be responsible for informing the Constellation (which informs the ScripThread) about paint metrics. This makes communication flow one way and removes one dependency between the compositor and script (of two). 3. All units tests are moved into the `metrics` crate itself since there is only one struct there now. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* compositor: Make `PipelineDetails` and pending paint metrics per-WebView ↵Martin Robinson2025-03-041-2/+5
| | | | | | | | | | | | | | | | (#35701) This is one of the first big steps toward making the compositor work per-WebView. It moves the collection of pipelines into the per-WebView data structure in the compositor as well as the pending paint metrics. This means that more messages need to carry information about the WebView they apply to. Note that there are still a few places that we need to map from `PipelineId` to `WebViewId`, so this also includes a shared mapping which tracks this. The mapping can be removed once event handling is fully per-WebView. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Delan Azabani <dazabani@igalia.com>
* Update rustfmt to the 2024 style edition (#35764)Simon Wülker2025-03-031-2/+2
| | | | | | | | | | | | | * Use 2024 style edition Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> * Reformat all code Signed-off-by: Simon Wülker <simon.wuelker@arcor.de> --------- Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
* script_traits: Rename `ConstellationControlMsg` to `ScriptThreadMessage` ↵Martin Robinson2025-01-301-4/+4
| | | | | | | | | | | (#35226) At some point in the past this message was only sent from the `Constellation` to `script`, but nowadays this is sent from various parts of servo to the `ScriptThread`, so this is a better name. In particular, the current name makes it seeem like this message controls the `Constellation`, which it does not. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* [NFC] Remove unused metrics code (#34370)Delan Azabani2024-11-251-24/+4
| | | Signed-off-by: Delan Azabani <dazabani@igalia.com>
* script: Create a `CrossProcessInstant` to enable serializable monotonic time ↵Martin Robinson2024-09-051-66/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#33282) Up until now, Servo was using a very old version of time to get a cross-process monotonic timestamp (using `time::precise_time_ns()`). This change replaces the usage of old time with a new serializable monotonic time called `CrossProcessInstant` and uses it where `u64` timestamps were stored before. The standard library doesn't provide this functionality because it isn't something you can do reliably on all platforms. The idea is that we do our best and then fall back gracefully. This is a big change, because Servo was using `u64` timestamps all over the place some as raw values taken from `time::precise_time_ns()` and some as relative offsets from the "navigation start," which is a concept similar to DOM's `timeOrigin` (but not exactly the same). It's very difficult to fix this situation without fixing it everywhere as the `Instant` concept is supposed to be opaque. The good thing is that this change clears up all ambiguity when passing times as a `time::Duration` is unit agnostic and a `CrossProcessInstant` represents an absolute moment in time. The `time` version of `Duration` is used because it can both be negative and is also serializable. Good things: - No need too pass around `time` and `time_precise` any longer. `CrossProcessInstant` is also precise and monotonic. - The distinction between a time that is unset or at `0` (at some kind of timer epoch) is now gone. There still a lot of work to do to clean up timing, but this is the first step. In general, I've tried to preserve existing behavior, even when not spec compliant, as much as possible. I plan to submit followup PRs fixing some of the issues I've noticed. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Move non-gfx things out of `gfx_traits` and create a `base` crate (#32296)Martin Robinson2024-05-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | For a long time, `gfx_traits` has held a lot of things unrelated to graphics and also unrelated to the `gfx` crate (which is mostly about fonts). This is a cleanup which does a few things: 1. Move non `gfx` crate things out of `gfx_traits`. This is important in order to prevent dependency cycles with a different integration between layout, script, and fonts. 2. Rename the `msg` crate to `base`. It didn't really contain anything to do with messages and instead mostly holds ids, which are used across many different crates in Servo. This new crate will hold the *rare* data types that are widely used. Details: - All BackgroundHangMonitor-related things from base to a new `background_hang_monitor_api` crate. - Moved `TraversalDirection` to `script_traits` - Moved `Epoch`-related things from `gfx_traits` to `base`. - Moved `PrintTree` to base. This should be widely useful in Servo. - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it to `WebRenderFontApi`.
* clippy: Fix assorted warnings in `components/` (#31628)eri2024-03-131-11/+7
| | | | | | | * clippy: fix assorted warnings in `components/` * fix: new and default * fix: review comments
* script: Do not run layout in a thread (#31346)Martin Robinson2024-02-231-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * script: Do not run layout in a thread Instead of spawning a thread for layout that almost always runs synchronously with script, simply run layout in the script thread. This is a resurrection of #28708, taking just the bits that remove the layout thread. It's a complex change and thus is just a first step toward cleaning up the interface between script and layout. Messages are still passed from script to layout via a `process()` method and script proxies some messages to layout from other threads as well. Big changes: 1. Layout is created in the script thread on Document load, thus every live document is guaranteed to have a layout. This isn't completely hidden in the interface, but we can safely `unwrap()` on a Document's layout. 2. Layout configuration is abstracted away into a LayoutConfig struct and the LayoutFactory is a struct passed around by the Constellation. This is to avoid having to monomorphize the entire script thread for each layout. 3. Instead of having the Constellation block on the layout thread to figure out the current epoch and whether there are pending web fonts loading, updates are sent synchronously to the Constellation when rendering to a screenshot. This practically only used by the WPT. A couple tests start to fail, which is probably inevitable since removing the layout thread has introduced timing changes in "exit after load" and screenshot behavior. Co-authored-by: Josh Matthews <josh@joshmatthews.net> * Update test expectations * Fix some issues found during review * Clarify some comments * Address review comments --------- Co-authored-by: Josh Matthews <josh@joshmatthews.net>
* Replace time with std::time in components/metrics & components/shared (#31020)Taym Haddadi2024-01-101-9/+23
|
* Strict import formatting (grouping and granularity) (#30325)Samson2023-09-111-5/+5
| | | | | * strict imports formatting * Reformat all imports
* remove `extern crate` (#30311)Samson2023-09-081-5/+2
| | | | | | | | | | | * remove extern crate * Update components/script_plugins/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Remove support for energy profilingSimon Sapin2020-06-041-2/+0
|
* Replace DisplayList::is_contentful with tracking during conversion to WR ↵Simon Sapin2019-09-061-3/+3
| | | | display lists
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition-idioms`Simon Sapin2018-11-081-10/+1
|
* Reorder importsPyfisch2018-11-061-2/+2
|
* Format metrics #21373kingdido9992018-09-111-23/+27
|
* added spec commentsddh2018-04-111-0/+2
|
* Decoupled gfx and metricsGeorg Streich2018-01-151-19/+2
|
* Print url of recorded PWMFernando Jiménez Moreno2017-12-071-5/+27
|
* Fix float conversion of paint timing metricsFernando Jiménez Moreno2017-12-071-2/+11
|
* added navigation start for interactive metricsddh2017-11-141-0/+6
|
* changed f64 to u64 for navigation start timing until it had to be floatddh2017-11-011-30/+30
|
* Fixes #19063Jacqueline Outka2017-10-311-1/+1
|
* added pipelines to all task sourcesddh2017-10-251-107/+65
| | | | changed task sources to accept pipeline ids
* added time to interactive metrics, refactored metrics to use traitsddh2017-10-241-72/+317
| | | | changed task macro to take pipeline info
* Add paint metrics to Performance Timeline APIFernando Jiménez Moreno2017-08-231-6/+21
|
* Wait for actual paint before setting paint related metricsFernando Jiménez Moreno2017-08-221-32/+74
|
* PWM testsFernando Jiménez Moreno2017-07-211-0/+12
|
* Implement basic Time To First Paint and First Contentful Paint PWMsFernando Jiménez Moreno2017-07-201-0/+113