Skip to content

refactor: improve taggedlen maintainability and logic - #578

Merged
alejandro-vaz merged 2 commits into
servo:v2from
fereidani:v2_taggedlen_refactor
Sep 5, 2026
Merged

refactor: improve taggedlen maintainability and logic#578
alejandro-vaz merged 2 commits into
servo:v2from
fereidani:v2_taggedlen_refactor

Conversation

@fereidani

@fereidani fereidani commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

In relation to #451,
This PR refactors taggedlen for better maintainability and slight sub percent performance improvement.

Highlights

  • with len.parts() we can stop reading on_heap/spilled flag multiple times.
  • ptr construction explicitly requires providing the on_heap value which avoids constructing invalid pointers and avoids recalculation of on_heap value inside function bodies again.
  • using new const MAX_LEN, SHIFT and TAG simplifies maintaining the taggedlen.rs.

@fereidani
fereidani force-pushed the v2_taggedlen_refactor branch from 7ff015d to d96d8d6 Compare September 4, 2026 19:46
@fereidani
fereidani force-pushed the v2_taggedlen_refactor branch from d96d8d6 to 04debc8 Compare September 4, 2026 19:53
Signed-off-by: Khashayar Fereidani <info@fereidani.com>
@fereidani

Copy link
Copy Markdown
Contributor Author

This also fixes clippy CI failure.

@alejandro-vaz alejandro-vaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

yeah this makes much more sense than what we had and it's easier to maintain

@alejandro-vaz
alejandro-vaz added this pull request to the merge queue Sep 5, 2026
Merged via the queue into servo:v2 with commit 557bf6f Sep 5, 2026
6 checks passed
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.

2 participants