Skip to content

script: Use inclusive_ancestors_unrooted in interior of UnrootedFollowingNodeIterator - #47158

Merged
yezhizhen merged 1 commit into
servo:mainfrom
Narfinger:use-complete-unrooted
Aug 12, 2026
Merged

yezhizhen merged 1 commit into
servo:mainfrom
Narfinger:use-complete-unrooted

Conversation

@Narfinger

Copy link
Copy Markdown
Contributor

This uses inclusive_ancestors_unrooted instead of the rooted variant in the interior of UnrootedFollowingNodeIterator (in next_skipping_children_impl).
Additionally, this PR relaxes the PartialEq for UnrootedDom to allow comparing UnrootedDom<'a,T> with UnrootedDom<'b, T>.

This saves 0.4% of cpu in a slice on walrusaudio.com

Testing: This does not have a specific testcase but inclusive_ancestors_unrooted is tested enough now to be equivalent to the rooted version. So this change should be equivalent.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
@Narfinger
Narfinger requested a review from gterzian as a code owner August 11, 2026 14:34
@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Aug 11, 2026

@yezhizhen yezhizhen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This saves 0.4% of cpu in a slice on walrusaudio.com

How to measure this?

@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Aug 12, 2026
@Narfinger

Copy link
Copy Markdown
Contributor Author

Measured with samply. Generally when I write 0.4% in slice it is picking a big slice where script thread is maxed and looking at the percentage of samply.

@yezhizhen
yezhizhen added this pull request to the merge queue Aug 12, 2026
@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 Aug 12, 2026
Merged via the queue into servo:main with commit 865a998 Aug 12, 2026
36 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 Aug 12, 2026
@Narfinger
Narfinger deleted the use-complete-unrooted branch August 12, 2026 08:20
eachra-bawn pushed a commit to eachra-bawn/servo that referenced this pull request Aug 12, 2026
…wingNodeIterator (servo#47158)

This uses inclusive_ancestors_unrooted instead of the rooted variant in
the interior of UnrootedFollowingNodeIterator (in
next_skipping_children_impl).
Additionally, this PR relaxes the PartialEq for UnrootedDom to allow
comparing UnrootedDom<'a,T> with UnrootedDom<'b, T>.

This saves 0.4% of cpu in a slice on walrusaudio.com

Testing: This does not have a specific testcase but
inclusive_ancestors_unrooted is tested enough now to be equivalent to
the rooted version. So this change should be equivalent.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
RichardTjokroutomo pushed a commit to RichardTjokroutomo/servo that referenced this pull request Oct 6, 2026
…wingNodeIterator (servo#47158)

This uses inclusive_ancestors_unrooted instead of the rooted variant in
the interior of UnrootedFollowingNodeIterator (in
next_skipping_children_impl).
Additionally, this PR relaxes the PartialEq for UnrootedDom to allow
comparing UnrootedDom<'a,T> with UnrootedDom<'b, T>.

This saves 0.4% of cpu in a slice on walrusaudio.com

Testing: This does not have a specific testcase but
inclusive_ancestors_unrooted is tested enough now to be equivalent to
the rooted version. So this change should be equivalent.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
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.

4 participants