aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/parallel.rs
Commit message (Collapse)AuthorAgeFilesLines
* Layout-2020: Fix debug mode crash for servo.orgMukilan Thiyagarajan2023-05-261-0/+6
| | | | | | | | | | | | | | | | | | | | | servo with layout-2020 segfaults when loading servo.org in debug build, but works fine in release build. It seems like the style pool threads seem to run overrun allocated stack space more quickly than in release mode. Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1376883 it seems the stack size was chosen base on several experiments. It is possible the results of those experiments are no longer valid. This is a temporary workaround to avoid layout 2020 builds from crashing when servo.org is loaded, until we can confirm the theory and implement a more robust solution. Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>
* Further changes required by ServoOriol Brufau2023-05-241-0/+2
|
* style: Remove the old profiler label frames code in the servo codebase and ↵Nazım Can Altınova2023-05-241-2/+2
| | | | | | replace it with the new API Differential Revision: https://phabricator.services.mozilla.com/D120795
* Simplify our setup for font metric queries from styleOriol Brufau2023-05-111-7/+4
| | | | | | | | This is a backport of https://phabricator.services.mozilla.com/D157589, by Emilio Cobos Álvarez, plus some additions so that Servo compiles, and some parts from https://phabricator.services.mozilla.com/D144455. Should have no change in behavior.
* Update arrayvec.Josh Matthews2022-04-011-1/+1
|
* style: Update smallvec to 1.0.Emilio Cobos Álvarez2019-12-161-2/+2
| | | | Differential Revision: https://phabricator.services.mozilla.com/D56044
* Update rayon to dedupe crossbeam-epochBastien Orivel2019-07-121-4/+4
| | | | As a bonus this also removes one version of crossbeam-utils
* style: Add Gecko profiler labels for when the style threads are doing work.Cameron McCormack2019-05-291-0/+2
| | | | Differential Revision: https://phabricator.services.mozilla.com/D30869
* Rustfmt has changed its default style :/Simon Sapin2018-12-281-1/+1
|
* Update MPL license to https (part 4)Jan Andre Ikenmeyer2018-11-191-1/+1
|
* `cargo fix --edition`Simon Sapin2018-11-101-4/+4
|
* Run rustfmt on selectors, servo_arc, and style.Bobby Holley2018-04-101-40/+39
| | | | | | | | | | This was generated with: ./mach cargo fmt --package selectors && ./mach cargo fmt --package servo_arc && ./mach cargo fmt --package style Using rustfmt 0.4.1-nightly (a4462d1 2018-03-26)
* style: Indent properly a couple more functions.Emilio Cobos Álvarez2018-02-241-12/+17
|
* Increase stack safety margin for stylo.Bobby Holley2017-09-071-10/+13
| | | | MozReview-Commit-ID: Fv9DttU20hM
* Fix up stack limit sanity assertions.Bobby Holley2017-08-251-0/+16
| | | | MozReview-Commit-ID: ILblsins91P
* Eliminate the sequential/traversal parallel distinction in favor of a ↵Bobby Holley2017-08-251-60/+7
| | | | | | unified adaptive driver. MozReview-Commit-ID: ADVTNJntzmp
* Switch to an iterator for traverse_nodes.Bobby Holley2017-08-251-19/+25
| | | | | | | We can't use a slice anymore, because the input might be the VecDeque from the sequential traversal, which requires an iterator to handle the ring buffer. MozReview-Commit-ID: JwH6MtRgMfY
* stylo: Drop thread pool stack size to 100K.Julian Seward2017-08-251-19/+22
| | | | Reviewed in bug 1376883 by bholley.
* Hoist StyleNew{Children,Subtree} into their own paths.Bobby Holley2017-08-111-30/+9
| | | | | | | | | | | | | The buggy animation handling isn't a regression, since currently we pass UnstyledChildrenOnly in those cases, which blocks the animation traversal in Servo_TraverseSubtree. In general I really wanted to handle these two paths together. But there's enough broken with the NewChildren path that I wanted to scope the buginess as tightly as possible. And I really need to separate the handling here from StyleDocument() to make the restyle root stuff work. MozReview-Commit-ID: 9F0mcQl7AAX
* Don't start kicking off work units during parallel stylo traversal until ↵Boris Zbarsky2017-08-011-13/+46
| | | | | | | they're actually full. This improves style sharing at the cost of a bit less parallelism. Fixes Gecko bug 1385982. r=bholley
* Pass a callback to recalc_style_at to avoid traversing children twice.Bobby Holley2017-07-151-7/+5
| | | | MozReview-Commit-ID: DIHXaVNzbFM
* Avoid memmoving the large smallvec in Parallel.rs.Bobby Holley2017-07-151-3/+2
| | | | MozReview-Commit-ID: 7nzjMwOmszZ
* Rip out the generic abstractions around ThreadLocalStyleContext.Bobby Holley2017-07-051-10/+14
| | | | MozReview-Commit-ID: 5WTLuk323Ac
* Bug 1368302 - stylo: possible stack overflow when processing very deep DOM. ↵Julian Seward2017-06-291-4/+23
| | | | | | | | | | r=bholley. Whilst working with variants of the bloom-basic test for Stylo perf profiling, I noticed that it is easy to cause Firefox to segfault on DOMs with a depth of more than about 1500 elements. This fix limits the use of tail recursion to 150 elements. This isn't externally observable to content -- we're still completely correct, just not using tail recursion any more.
* Use ArrayVec and tweak the SmallVec sizes.Bobby Holley2017-06-141-16/+24
| | | | MozReview-Commit-ID: 1tEZiPdp9WQ
* Eliminate an unnecessary heap allocation.Bobby Holley2017-06-141-5/+6
| | | | MozReview-Commit-ID: 4cleAH0JsKK
* Don't do recursive tail calls if there's work in the queue.Bobby Holley2017-06-141-29/+24
| | | | MozReview-Commit-ID: 8JEdjqAIYmQ
* style: Distinguish between the tree structures used for traversal and ↵Cameron McCormack2017-06-091-1/+1
| | | | | | | | | | | | selector matching. This patch renames TNode::parent_element to traversal_parent, since it returns the parent from the perspective of traversal (which in Gecko uses the flattened tree). It also renames TNode::children to traversal_children for the saem reason. We keep parent_element and children functions on TNode to use for selector matching, which must be done on the real DOM tree structure.
* Increase the size of the style sharing cache to 31.Boris Zbarsky2017-06-081-14/+2
| | | | | Still a lot of guesswork here, but this does seem to get us better sharing. See https://bugzilla.mozilla.org/show_bug.cgi?id=1369621 for some data.
* Reduce the size of top_down_dom stackframes.Boris Zbarsky2017-06-081-1/+15
| | | | The idea is to put the memmoving of the ThreadLocalContext out of line from the point of view of top_down_dom so we don't need to allocate a large chunk of stack space for it.
* Back out https://github.com/servo/servo/pull/17198 for Gecko test failuresBoris Zbarsky2017-06-071-6/+4
|
* Increase the size of the style sharing cache to 31.Boris Zbarsky2017-06-061-4/+6
| | | | | Still a lot of guesswork here, but this does seem to get us better sharing. See https://bugzilla.mozilla.org/show_bug.cgi?id=1369621 for some data.
* Rewrite parallel.rs to be not slow.Bobby Holley2017-05-211-35/+149
|
* Limit traversal statistics dumps to subtrees of 50 or more elements.Bobby Holley2017-04-131-1/+3
| | | | | On Gecko, we get tons of console spam from 1-element traversals if we don't do this.
* Store style system options in the global style data and shared style context.Bobby Holley2017-04-121-1/+1
| | | | | | | | I wanted to add an environmental variable to disable the style sharing cache for gecko, but the current pattern involves lazy_static!, which involves an atomic operation on lookup, which is a bit hot to do each time we try to share styles. This makes that work happen once per process.
* Do the sequential traversal breadth-first.Bobby Holley2017-04-091-7/+3
| | | | | | | | | | | | | While we're at it, we also eliminate the 'unknown' dom depth for the bloom filter. Computing depth has negligible cost relative to the amount of work we do setting up the bloom filter at a given depth. Doing it once per traversal should be totally fine. I originally separated the elimination of unknown dom depth from the traversal changes, but I got bloom filter crashes on the intermediate patch, presumably because I didn't properly fix the sequential traversal for this case. Given that the final state is green, I just decided to squash and move on.
* Factor out the bottom-up postorder traversal logic.Bobby Holley2017-04-091-54/+2
|
* style: Add the traversal kind to the style stats.Emilio Cobos Álvarez2017-03-111-1/+1
|
* Dump traversal time with other style statistics.Bobby Holley2017-02-141-2/+7
|
* Bug 1336646 - Move opts check for statistics into should_dump. r=emilioBobby Holley2017-02-081-2/+1
| | | | This makes things more consistent between the parallel and sequential traversal drivers.
* style: Expose the traversal kind to the style system.Emilio Cobos Álvarez2017-01-241-0/+1
| | | | | | | This way we'll be able to take different paths for the sequential and parallel traversals in some concrete cases. This is a preliminar patch to fix bug 1332525.
* Bug 1331856 - Add style performance statistics to Servo. r=emilioBobby Holley2017-01-191-14/+12
| | | | MozReview-Commit-ID: ECHZgYNA8nb
* Bug 1325734 - Pass the thread-local context into should_traverse_children. ↵Bobby Holley2017-01-091-1/+1
| | | | r=emilio
* Bug 1325734 - Parameterize the style traversal on TElement instead of TNode. ↵Bobby Holley2017-01-091-14/+14
| | | | | | r=emilio This works around the issue described in https://github.com/rust-lang/rust/issues/38917
* style: Document the parallel traversal.Emilio Cobos Álvarez2016-12-311-2/+8
|
* Stop using UnsafeNode in the parallel traversal.Bobby Holley2016-12-221-19/+29
| | | | \o/ \o/ \o/
* Introduce and use Scoped TLS.Bobby Holley2016-12-211-45/+50
| | | | | | | | | | | | | | | | It turns out that it's problematic to embed ThreadLocalStyleContext within LayoutContext, because parameterizing the former on TElement (which we do in the next patch) infects all the traversal stuff with the trait parameters, which we don't really want. In general, it probably makes sense to use separate scoped TLS types for the separate DOM and Flow tree passes, so we can add a different ScopedTLS type for the Flow pass if we ever need it. We also reorder the |scope| and |shared| parameters in parallel.rs, because it aligns more with the order in style/parallel.rs. I did this when I was adding a TLS parameter to all these functions, which I realized we don't need for now.
* Make the DomTraversalContext own the SharedStyleContext and share it ↵Bobby Holley2016-12-161-28/+26
| | | | | | | | | | immutably across the traversal. This allows us to get rid of a bunch of lifetimes and simplify a lot of code. It also lets us get rid of that nasty lifetime transmute, which is awesome. The situation with thread-local contexts is still suboptimal, but we fix that in subsequent patches.
* Removed util.Alan Jeffrey2016-12-141-1/+1
|
* Bug 1322945 - Change skip_root to unstyled_children_only and use ↵Bobby Holley2016-12-121-6/+10
| | | | | | | | | | | | | | | | | | | | | | | StyleNewChildren in more places. r=heycam I noticed that our current behavior in ContentRangeInserted is incorrect. Unlike ContentInserted (where this code lived originally), ContentRangeInserted takes a start and end element. I'm not sure if we ever take that path for new content that needs style, but it seemed sketchy. And generally, it seems nice to just always style new content the same way (though we still need to style NAC by the subtree root, since it hasn't been attached to the parent yet). For situations where there is indeed only one unstyled child, the traversal overhead should be neglible, since we special-case the single-element in parallel.rs to avoid calling into rayon. Being more explicit about what we want here also makes us more robust against the other handful of callpaths that can take us into nsCSSFrameConstructor::{ContentRangeInserted,ContentAppended}. Currently we can call StyleNewSubtree on an already-styled element via RecreateFramesForContent, which triggers an assertion in the servo traversal. MozReview-Commit-ID: DqCGh90deHH