mirror of
https://github.com/servo/servo.git
synced 2025-07-22 14:53:49 +01:00
Rename lots of profiling-related things.
------------------------------------------------------------------------ BEFORE AFTER ------------------------------------------------------------------------ util::memory util::mem - heap_size_of - heap_size_of (unchanged) - SizeOf - HeapSizeOf - size_of_excluding_self - heap_size_of_children prof::mem prof::mem - MemoryProfilerChan - ProfilerChan - MemoryReport - Report - MemoryReportsChan - ReportsChan - MemoryReporter - Reporter - MemoryProfilerMsg - ProfilerMsg - {R,UnR}egisterMemoryReporter - {R,UnR}egisterReporter - MemoryProfiler - Prof - ReportsForest - ReportsForest (unchanged) - ReportsTree - ReportsTree (unchanged) - SystemMemoryReporter - SystemReporter prof::time prof::time - TimeProfilerChan - ProfilerChan - TimerMetadata - TimerMetadata (unchanged) - Formatable - Formattable [spelling!] - TimeProfilerMsg - ProfilerMsg - TimeProfilerCategory - ProfilerCategory - TimeProfilerBuckets - ProfilerBuckets - TimeProfiler - Profiler - TimerMetadataFrameType - TimerMetadataFrameType (unchanged) - TimerMetadataReflowType - TimerMetadataReflowType (unchanged) - ProfilerMetadata - ProfilerMetadata (unchanged) In a few places both prof::time and prof::mem are used, and so module-qualification is needed to avoid overlap, e.g. time::Profiler and mem::Profiler. Likewise with std::mem and prof::mem. This is not a big deal.
This commit is contained in:
parent
7f587f6cb5
commit
ce36e574f4
19 changed files with 322 additions and 331 deletions
|
@ -7,7 +7,7 @@ use resource_task;
|
|||
use resource_task::{LoadData, ResourceTask};
|
||||
use resource_task::ProgressMsg::{Payload, Done};
|
||||
|
||||
use profile::time::{self, profile, TimeProfilerChan};
|
||||
use profile::time::{self, profile};
|
||||
use std::borrow::ToOwned;
|
||||
use std::collections::HashMap;
|
||||
use std::collections::hash_map::Entry::{Occupied, Vacant};
|
||||
|
@ -75,7 +75,7 @@ pub struct ImageCacheTask {
|
|||
|
||||
impl ImageCacheTask {
|
||||
pub fn new(resource_task: ResourceTask, task_pool: TaskPool,
|
||||
time_profiler_chan: TimeProfilerChan) -> ImageCacheTask {
|
||||
time_profiler_chan: time::ProfilerChan) -> ImageCacheTask {
|
||||
let (chan, port) = channel();
|
||||
let chan_clone = chan.clone();
|
||||
|
||||
|
@ -99,7 +99,7 @@ impl ImageCacheTask {
|
|||
}
|
||||
|
||||
pub fn new_sync(resource_task: ResourceTask, task_pool: TaskPool,
|
||||
time_profiler_chan: TimeProfilerChan) -> ImageCacheTask {
|
||||
time_profiler_chan: time::ProfilerChan) -> ImageCacheTask {
|
||||
let (chan, port) = channel();
|
||||
|
||||
spawn_named("ImageCacheTask (sync)".to_owned(), move || {
|
||||
|
@ -141,7 +141,7 @@ struct ImageCache {
|
|||
wait_map: HashMap<Url, Arc<Mutex<Vec<Sender<ImageResponseMsg>>>>>,
|
||||
need_exit: Option<Sender<()>>,
|
||||
task_pool: TaskPool,
|
||||
time_profiler_chan: TimeProfilerChan,
|
||||
time_profiler_chan: time::ProfilerChan,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
|
@ -314,7 +314,7 @@ impl ImageCache {
|
|||
self.task_pool.execute(move || {
|
||||
let url = url_clone;
|
||||
debug!("image_cache_task: started image decode for {}", url.serialize());
|
||||
let image = profile(time::TimeProfilerCategory::ImageDecoding,
|
||||
let image = profile(time::ProfilerCategory::ImageDecoding,
|
||||
None, time_profiler_chan, || {
|
||||
load_from_memory(&data)
|
||||
});
|
||||
|
@ -495,7 +495,7 @@ mod tests {
|
|||
use resource_task::ProgressMsg::{Payload, Done};
|
||||
use sniffer_task;
|
||||
use image::base::test_image_bin;
|
||||
use profile::time::{TimeProfiler, TimeProfilerChan};
|
||||
use profile::time;
|
||||
use std::sync::mpsc::{Sender, channel, Receiver};
|
||||
use url::Url;
|
||||
use util::taskpool::TaskPool;
|
||||
|
@ -587,8 +587,8 @@ mod tests {
|
|||
})
|
||||
}
|
||||
|
||||
fn profiler() -> TimeProfilerChan {
|
||||
TimeProfiler::create(None)
|
||||
fn profiler() -> time::ProfilerChan {
|
||||
time::Profiler::create(None)
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue