Skip to content

fix: reserve capacity - #176

Closed
usamoi wants to merge 1 commit into
supervc-stack:mainfrom
usamoi:with-cap
Closed

fix: reserve capacity#176
usamoi wants to merge 1 commit into
supervc-stack:mainfrom
usamoi:with-cap

Conversation

@usamoi

Copy link
Copy Markdown
Contributor

No description provided.

@usamoi
usamoiforce-pushed the with-cap branch 2 times, most recently from caa9cc1 to 995300bCompareFebruary 8, 2025 07:44
@usamoi

Copy link
Copy Markdown
ContributorAuthor

Why CI does not run?

@VoVAllen

Copy link
Copy Markdown
Contributor

https://github.com/tensorchord/VectorChord/blob/main/.github/workflows/rust.yml#L4-L11

Signed-off-by: usamoi <usamoi@outlook.com>
@usamoi

usamoi commented Feb 8, 2025

Copy link
Copy Markdown
ContributorAuthor

Tests show it's a debuff (33% slower).

@VoVAllen

Copy link
Copy Markdown
Contributor

I don't understand why reserve capacity for vec will degrade the performance

@usamoi

Copy link
Copy Markdown
ContributorAuthor

I don't understand why reserve capacity for vec will degrade the performance

To know exact capacity, the process save it in a vector when scanning and make heap on it. The vector becomes bigger since the elements become bigger. It's unfriendly to cache.

@VoVAllen

Copy link
Copy Markdown
Contributor

We don't need exact size I think. Just some estimation should work?

@VoVAllen

Copy link
Copy Markdown
Contributor

Our target is just to reduce the number of resizing not really eliminate it

@usamoi

Copy link
Copy Markdown
ContributorAuthor

replaced by #182

@usamoiusamoi closed this Feb 8, 2025
Sign up for freeto 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

@usamoi@VoVAllen