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

[TransferEngine]chore: replace slices vector with slice counter #93

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RuixiangMa
Copy link

Since the slices are solely utilized for counting purposes, replace them with counters to eliminate memory overhead

@alogfans
Copy link
Collaborator

LGTM

Copy link
Collaborator

@stmatengss stmatengss left a comment

Choose a reason for hiding this comment

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

Why use slice counter to replace slices vector? It is a performance consideration or something?

@RuixiangMa
Copy link
Author

RuixiangMa commented Jan 24, 2025

Why use slice counter to replace slices vector? It is a performance consideration or something?

In the origin design, it appears that the sole requirement is for counting functionality.
Accessing and updating a single counter is generally faster than manipulating a vector, especially as the size of the vector grows. Operations like insertion on vectors can become costly as they may require shifting elements.

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.

3 participants