请问下Buffer::readFd中的 char extrabuf[65536]可以定义成成员变量吗? #602
Answered
by
chenshuo
wangdongyu1989
asked this question in
Q&A
-
还有 char extrabuf[65536]; 这个长度可以扩大吗 或者有其他考虑? 多谢 |
Beta Was this translation helpful? Give feedback.
Answered by
chenshuo
Mar 17, 2020
Replies: 1 comment
-
你如果定义成成员变量,会增加每个 Buffer 的内存开销。 如果你的 stack 够大,在 benchmark 证明确有性能提高的前提下, |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
chenshuo
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你如果定义成成员变量,会增加每个 Buffer 的内存开销。
我觉得就失去 stack buffer 的意义了。
如果你的 stack 够大,在 benchmark 证明确有性能提高的前提下,
可以扩大到 128K 或 256K。再大我估计就没啥意义了。