Add a profile_traits crate to reduce compile times.

A rebuild after touching components/profile/mem.rs now takes 48 seconds (and
only rebuilds `profile` and `servo`) which is much lower than it used to be.
In comparison, a rebuild after touching components/profile_traits/mem.rs takes
294 seconds and rebuilds many more crates.

This change also removes some unnecessary crate dependencies in `net` and
`net_traits`.
This commit is contained in:
Nicholas Nethercote 2015-04-29 21:36:03 -07:00
parent 826b722202
commit 092507d23c
37 changed files with 269 additions and 225 deletions

View file

@ -22,8 +22,8 @@ path = "../msg"
[dependencies.net]
path = "../net"
[dependencies.profile]
path = "../profile"
[dependencies.profile_traits]
path = "../profile_traits"
[dependencies.net_traits]
path = "../net_traits"

View file

@ -32,8 +32,8 @@ use msg::constellation_msg::{ConstellationChan, NavigationDirection};
use msg::constellation_msg::{Key, KeyModifiers, KeyState, LoadData};
use msg::constellation_msg::{PipelineId, WindowSizeData};
use png;
use profile::mem;
use profile::time::{self, ProfilerCategory, profile};
use profile_traits::mem;
use profile_traits::time::{self, ProfilerCategory, profile};
use script_traits::{ConstellationControlMsg, ScriptControlChan};
use std::cmp;
use std::collections::HashMap;

View file

@ -21,8 +21,8 @@ use msg::compositor_msg::{Epoch, LayerId, LayerMetadata, ReadyState};
use msg::compositor_msg::{PaintListener, PaintState, ScriptListener, ScrollPolicy};
use msg::constellation_msg::{ConstellationChan, PipelineId};
use msg::constellation_msg::{Key, KeyState, KeyModifiers};
use profile::mem;
use profile::time;
use profile_traits::mem;
use profile_traits::time;
use std::sync::mpsc::{channel, Sender, Receiver};
use std::fmt::{Error, Formatter, Debug};
use std::rc::Rc;

View file

@ -23,8 +23,8 @@ use msg::constellation_msg::{self, ConstellationChan, Failure};
use net_traits::{self, ResourceTask};
use net_traits::image_cache_task::ImageCacheTask;
use net_traits::storage_task::{StorageTask, StorageTaskMsg};
use profile::mem;
use profile::time;
use profile_traits::mem;
use profile_traits::time;
use script_traits::{CompositorEvent, ConstellationControlMsg};
use script_traits::{ScriptControlChan, ScriptTaskFactory};
use std::borrow::ToOwned;

View file

@ -9,8 +9,8 @@ use geom::scale_factor::ScaleFactor;
use geom::size::TypedSize2D;
use msg::constellation_msg::Msg as ConstellationMsg;
use msg::constellation_msg::{ConstellationChan, WindowSizeData};
use profile::mem;
use profile::time;
use profile_traits::mem;
use profile_traits::time;
/// Starts the compositor, which listens for messages on the specified port.
///

View file

@ -22,7 +22,7 @@ extern crate png;
extern crate script_traits;
extern crate msg;
extern crate net;
extern crate profile;
extern crate profile_traits;
extern crate net_traits;
#[macro_use]
extern crate util;

View file

@ -16,8 +16,8 @@ use gfx::font_cache_task::FontCacheTask;
use layers::geometry::DevicePixel;
use msg::constellation_msg::{ConstellationChan, Failure, FrameId, PipelineId, SubpageId};
use msg::constellation_msg::{LoadData, WindowSizeData, PipelineExitType, MozBrowserEvent};
use profile::mem;
use profile::time;
use profile_traits::mem;
use profile_traits::time;
use net_traits::ResourceTask;
use net_traits::image_cache_task::ImageCacheTask;
use net_traits::storage_task::StorageTask;