Skip to content

Optimize mapping rule properties to strings and engines - #14945

Merged
vaxerski merged 1 commit into
hyprwm:mainfrom
danielkrupinski:rule-opt
Jun 5, 2026
Merged

Optimize mapping rule properties to strings and engines#14945
vaxerski merged 1 commit into
hyprwm:mainfrom
danielkrupinski:rule-opt

Conversation

@danielkrupinski

Copy link
Copy Markdown
Contributor

Before

  • MATCH_PROP_STRINGS allocated heap memory
  • RULE_ENGINES allocated heap memory
  • Rule::allMatchPropStrings() allocated heap memory
  • 3 copies of prop strings existed in memory - string literals in the binary file and 2 copies in the heap memory
  • Linear search in Rule::matchPropFromString()

After

  • No heap memory allocations
  • Only 1 instance of prop strings in memory
  • Binary search in Rule::matchPropFromString()

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

Hello and thank you for making a PR to Hyprland!

Please check the PR Guidelines and make sure your PR follows them.
It will make the entire review process faster. :)

If your code can be tested, please always add tests. See more here.

beep boop, I'm just a bot. A real human will review your PR soon.

@vaxerski vaxerski 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.

thanks!

@vaxerski
vaxerski merged commit 60804ca into hyprwm:main Jun 5, 2026
10 checks passed
Psilocybin78 pushed a commit to Psilocybin78/Singularity-compositor that referenced this pull request Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants