Skip to content

Reduce IO vectors when encoding redis message. - #1833

Merged
Barenboim merged 1 commit into
sogou:masterfrom
Barenboim:master
Oct 30, 2026
Merged

Barenboim merged 1 commit into
sogou:masterfrom
Barenboim:master

Conversation

@Barenboim

Copy link
Copy Markdown
Contributor

No description provided.

else
{
stream.append_copy("$" + std::to_string(reply->len) + "\r\n" +
std::string(reply->str, reply->len) + "\r\n");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

或许应把std::string(reply->str, reply->len)这次构造优化掉,虽然它不大,但依然引入了一次内存分配和一次内存拷贝。

@Barenboim
Barenboim merged commit bd4556f into sogou:master Oct 30, 2026
3 checks passed
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