Skip to content

Commit

Permalink
Avoid debug serialization of PropertyDeclaration & co in release builds.
Browse files Browse the repository at this point in the history
In total, this PR saves ~60k.

The conditional compilation on the _Debug FFI function eliminates one
of the ToCss variants, eliminating 54.4k, as well as a bunch of other
<1k functions. Removing the public trait implementation of Debug for the
font metrics provider eliminates the last Debug impl from stylo.

MozReview-Commit-ID: nIfQ3sy4OW
  • Loading branch information
bholley committed Jan 15, 2018
1 parent 2ff3e11 commit f692ea6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 1 addition & 2 deletions components/style/font_metrics.rs
Expand Up @@ -12,7 +12,6 @@ use context::SharedStyleContext;
use logical_geometry::WritingMode;
use media_queries::Device;
use properties::style_structs::Font;
use std::fmt;

/// Represents the font metrics that style needs from a font to compute the
/// value of certain CSS units like `ex`.
Expand All @@ -35,7 +34,7 @@ pub enum FontMetricsQueryResult {
}

/// A trait used to represent something capable of providing us font metrics.
pub trait FontMetricsProvider: fmt::Debug {
pub trait FontMetricsProvider {
/// Obtain the metrics for given font family.
///
/// TODO: We could make this take the full list, I guess, and save a few
Expand Down
1 change: 1 addition & 0 deletions ports/geckolib/glue.rs
Expand Up @@ -1438,6 +1438,7 @@ macro_rules! impl_basic_rule_funcs_without_getter {
debug: $debug:ident,
to_css: $to_css:ident,
} => {
#[cfg(debug_assertion)]
#[no_mangle]
pub extern "C" fn $debug(rule: &$raw_type, result: *mut nsACString) {
read_locked_arc(rule, |rule: &$rule_type| {
Expand Down

0 comments on commit f692ea6

Please sign in to comment.