Skip to content

Conversation

@webbeef
Copy link
Contributor

@webbeef webbeef commented Nov 19, 2025

  • Change how the static node list is built to prevent a second iteration of new_nodes
  • Memoize some invariants of the parent

Testing: No wpt regressions: https://github.com/webbeef/servo/actions/runs/19493174678

This improves the parseFromString() benchmark by ~7% on my machine.

- Change how the static node list is built to prevent a second iteration of new_nodes
- Memoize some invariants of the parent

Signed-off-by: webbeef <me@webbeef.org>
@webbeef webbeef requested a review from gterzian as a code owner November 19, 2025 15:30
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 19, 2025
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 19, 2025
@TimvdLippe
Copy link
Contributor

How does this relate to #37583 (e.g. does it supersede it or is it extra) and does this sufficiently address #37223 compared to other browsers?

@webbeef
Copy link
Contributor Author

webbeef commented Nov 20, 2025

It doesn't solve the exact same case as #37583 so we could still benefit from it (though I don't think it was very successful in practice).

It's not sufficient to close #37223 : this improves the DOM side a bit, but we likely also are too slow on the parsing and tree construction. On my machine we're still much slower than Firefox.

@webbeef
Copy link
Contributor Author

webbeef commented Nov 20, 2025

Some timings for #37223 with this patch:

  • Servo production build: ~250ms
  • Firefox nightly: ~45ms

Even if Firefox has the benefit of a PGO build, the gap is still very large.

@jschwe jschwe added this pull request to the merge queue Nov 20, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 20, 2025
Merged via the queue into servo:main with commit 135bc7d Nov 20, 2025
35 checks passed
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants