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: faster update #343

Closed
wants to merge 2 commits into from
Closed

feat: faster update #343

wants to merge 2 commits into from

Conversation

friendlymatthew
Copy link
Collaborator

Insert is the hottest function we call when dealing with DistHeap. However, Insert is actually Upsert. If the id already exists, we iterate through and call Fix(). Worst case this is O(n).

Now updating should be bound to Fix() which is O(log n)

Copy link

github-actions bot commented Jun 14, 2024

Copy link
Owner

@kevmo314 kevmo314 left a comment

Choose a reason for hiding this comment

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

Nice find!

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