New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stylo: various fixes to improve style logging in opt builds #15557
Conversation
Heads up! This PR modifies the following files:
|
r? @emilio |
} | ||
|
||
/// Implementation of Add to aggregate statistics across different threads. | ||
impl<'a> Add for &'a TraversalStatistics { | ||
type Output = TraversalStatistics; | ||
fn add(self, other: Self) -> TraversalStatistics { | ||
debug_assert!(self.traversal_time_ms == 0.0 && other.traversal_time_ms == 0.0, | ||
"traversal_time_ms should be set at the end by the caller"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to me this shouldn't live in TraversalStatistics
, though I see why you're doing it. I guess it's fine for now unless it becomes way more complicated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I just wanted it to show up in the same perf block for @shinglyu's automation, and this seemed like the simplest way to do it.
I agree it's a bit gross. The other way I considered was that each TraversalStatistics would capture a start time when instantiated, and then we'd take the min when we merge them, and rely on the fact that we must instantiate at least one ThreadLocalStyleContext (and therefore TraversalStatistics) very near to the beginning of the traversal. But that seemed like it required a lot of knowledge about the style system for people to verify that it was measuring the right thing, so I went with the dumb approach.
@bors-servo r+ |
📌 Commit ae87b8a has been approved by |
stylo: various fixes to improve style logging in opt builds This adds a traversal time entry to the style statistics, and switches to warn! as discussed in [1]. [1] https://bugzilla.mozilla.org/show_bug.cgi?id=1339176 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15557) <!-- Reviewable:end -->
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-gnu-dev, windows-msvc-dev |
This adds a traversal time entry to the style statistics, and switches to warn! as discussed in [1].
[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1339176
This change is