diff options
author | Nicholas Nethercote <nnethercote@mozilla.com> | 2015-03-10 21:01:05 -0700 |
---|---|---|
committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2015-03-16 18:12:26 -0700 |
commit | ece2711185cffa8ade21b0ab9538bc1be79cadb9 (patch) | |
tree | 5870d8186ce791809ad1afcf65886767ea871a6b /components/compositing/pipeline.rs | |
parent | 5865d5f71776336d8f55dcb326d1fb24279bbf63 (diff) | |
download | servo-ece2711185cffa8ade21b0ab9538bc1be79cadb9.tar.gz servo-ece2711185cffa8ade21b0ab9538bc1be79cadb9.zip |
Add memory reporting infrastructure and use it to measure the display list.
This changeset implements the beginnings of fine-grained measurement of
Servo's data structures.
- It adds a new `SizeOf` trait, which is used to measure the memory used
by heap data structures, and implements it for some std types: Box,
String, Option, Arc, Vec, and DList.
- It adds a new `MemoryReporter` trait which is used to report memory
measurements from other threads to the memory profiler. Reporters are
registered and unregistered with the memory profiler, and the memory
profiler makes measurement requests of reporters when necessary.
- It plumbs a MemoryProfilerChan through to the layout task so it can
register a memory reporter.
- It implements the `SizeOf` trait for `DisplayList` and associated
types, and adds a memory reporter that uses it.
The display list hits 14.77 MiB when viewing
tests/html/perf-rainbow.html, and 2.51 MiB when viewing the Guardians of
the Galaxy Wikipedia page from servo-static-suite. Example output:
0.29: display-list::http://www.reddit.com/
0.00: display-list::http://static.adzerk.net/reddit/ads.html?sr=-reddit.com,loggedout&bust2#http://www.reddit.com
0.00: display-list::http://www.reddit.com/static/createadframe.html
There are a number of FIXME comments indicating sub-optimal things. This
is a big enough change for now that doing them as follow-ups seems best.
Diffstat (limited to 'components/compositing/pipeline.rs')
-rw-r--r-- | components/compositing/pipeline.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/compositing/pipeline.rs b/components/compositing/pipeline.rs index edfbae48a2a..1c817cc845a 100644 --- a/components/compositing/pipeline.rs +++ b/components/compositing/pipeline.rs @@ -19,6 +19,7 @@ use net::resource_task::ResourceTask; use net::storage_task::StorageTask; use url::Url; use util::geometry::{PagePx}; +use util::memory::MemoryProfilerChan; use util::time::TimeProfilerChan; use std::sync::mpsc::{Receiver, channel}; @@ -61,6 +62,7 @@ impl Pipeline { resource_task: ResourceTask, storage_task: StorageTask, time_profiler_chan: TimeProfilerChan, + memory_profiler_chan: MemoryProfilerChan, window_size: Option<WindowSizeData>, script_chan: Option<ScriptControlChan>, load_data: LoadData) @@ -123,6 +125,7 @@ impl Pipeline { LayoutTaskFactory::create(None::<&mut LTF>, id, + load_data.url.clone(), layout_pair, pipeline_port, constellation_chan, @@ -133,6 +136,7 @@ impl Pipeline { image_cache_task, font_cache_task, time_profiler_chan, + memory_profiler_chan, layout_shutdown_chan); Pipeline::new(id, |