mirror of
https://github.com/servo/servo.git
synced 2025-07-16 03:43:38 +01:00
net: Report memory usage for image cache. (#36556)
These changes add a new report for image cache memory usage for each script thread. Testing: Looked at the numbers after browsing various stock photo sites that show galleries of images. Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
f16f625c9b
commit
afe98e9e1e
6 changed files with 49 additions and 7 deletions
|
@ -2435,11 +2435,14 @@ impl ScriptThread {
|
|||
let documents = self.documents.borrow();
|
||||
let urls = itertools::join(documents.iter().map(|(_, d)| d.url().to_string()), ", ");
|
||||
|
||||
let mut reports = self.get_cx().get_reports(format!("url({})", urls));
|
||||
let prefix = format!("url({urls})");
|
||||
let mut reports = self.get_cx().get_reports(prefix.clone());
|
||||
for (_, document) in documents.iter() {
|
||||
document.window().layout().collect_reports(&mut reports);
|
||||
}
|
||||
|
||||
reports.push(self.image_cache.memory_report(&prefix));
|
||||
|
||||
reports_chan.send(ProcessReports::new(reports));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue