Skip to content

perf(cache): fix slice capacity under-allocation in SetUserOnline#3746

Open
buvidk1234 wants to merge 1 commit into
openimsdk:mainfrom
buvidk1234:fix/online-status
Open

perf(cache): fix slice capacity under-allocation in SetUserOnline#3746
buvidk1234 wants to merge 1 commit into
openimsdk:mainfrom
buvidk1234:fix/online-status

Conversation

@buvidk1234

Copy link
Copy Markdown
Contributor

The argv slice was initialized with a capacity of 2, but 4 metadata
parameters were immediately appended. This caused an unnecessary
reallocation on every status update.

Corrected the initial capacity to 4 to avoid extra memory allocation
in the high-concurrency online status sync path.

@pull-request-size pull-request-size Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant