Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • wlroots wlroots
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 325
    • Issues 325
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 133
    • Merge requests 133
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • wlrootswlroots
  • wlrootswlroots
  • Merge requests
  • !3806

Draft: util/addon: use AVL trees

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Kirill Primak requested to merge vyivel/wlroots:addon-tree into master Oct 26, 2022
  • Overview 6
  • Commits 1
  • Pipelines 2
  • Changes 2

Just a proof of concept which replaces linked lists with AVL trees. Might be useful if wlr_addon_find() performance will ever end up being a bottleneck.

The implementation is largely based on the corresponding Wikipedia article.

  • Lookup is now O(log n) instead of O(n)
  • Insertion is now O(log n) instead of O(1)
  • Deletion is now O(log n) instead of O(1)
  • Set cleanup is now O(n log n) instead of O(n)
    • Due to unnecessary rebalancing; this can probably be optimized
  • None of this was benchmarked
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: addon-tree