Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Optimize Governor Contract's Memory Usage #20

Merged
merged 10 commits into from
Aug 26, 2024
Merged

feat: Optimize Governor Contract's Memory Usage #20

merged 10 commits into from
Aug 26, 2024

Conversation

notJoon
Copy link
Member

@notJoon notJoon commented Aug 14, 2024

Description

Changed governor's data structures from maps to AVL tree.

Key Advantages

  • Improve time complexity for search, insertion, and deletion operations: O(n) -> O(log n)
  • Enhanced memory usage efficiency: AVL trees reduce unnecessary space waste through self-balancing

This change will be better handled when processing large amounts of data.

@notJoon notJoon added the enhancement New feature or request label Aug 14, 2024
@notJoon notJoon requested review from AkydA and r3v4s August 14, 2024 05:45
@notJoon notJoon self-assigned this Aug 14, 2024
governor/getter_test.gno Outdated Show resolved Hide resolved
governor/gov.gno Outdated Show resolved Hide resolved
Copy link
Member

@r3v4s r3v4s left a comment

Choose a reason for hiding this comment

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

Left few comments.

Before fixing this pr, resolve #19 first, then rebase this pr branch.

Seems like #19 and #20 shares pretty much of code.

governor/gov.gno Outdated Show resolved Hide resolved
@notJoon notJoon requested a review from r3v4s August 21, 2024 02:04
@r3v4s r3v4s merged commit 4e97bac into main Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants