Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Use BTreeSet for CID allocations (instead of Vec) #159

Merged
merged 2 commits into from
Mar 21, 2024

Conversation

tuommaki
Copy link
Contributor

@tuommaki tuommaki commented Mar 21, 2024

Using set for CID allocations provides better API.

There's also some slow behavior in releasing of existing CID, which can cause conflicts with random allocation. Therefore the CID allocation here uses sequential approach, jumping over already-reserved ones, so that probability of hitting a recently released CID is as low as possible.

Using set for CID allocations provides better API.
@tuommaki tuommaki requested a review from musitdev March 21, 2024 09:29
@tuommaki tuommaki self-assigned this Mar 21, 2024
@tuommaki tuommaki marked this pull request as ready for review March 21, 2024 09:29
@tuommaki tuommaki merged commit a5ac802 into main Mar 21, 2024
4 checks passed
@tuommaki tuommaki deleted the improve-cid-allocation branch March 21, 2024 10:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants