-
Notifications
You must be signed in to change notification settings - Fork 544
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
perf: revert NewChunkedBodyWriter #993
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #993 +/- ##
===========================================
- Coverage 81.81% 81.78% -0.03%
===========================================
Files 98 98
Lines 9962 9949 -13
===========================================
- Hits 8150 8137 -13
Misses 1319 1319
Partials 493 493 ☔ View full report in Codecov by Sentry. |
e5b4c7e
to
b28d0ab
Compare
增加一个revert前后的perf火焰图+benchmark数据看看哈 |
b28d0ab
to
63128c7
Compare
Flame graphbefore:after:wrk 压测
|
benchmark @Skyenought |
63128c7
to
36c1134
Compare
|
36c1134
to
afeb535
Compare
感谢,我晚些时候看看,影响面应该在使用内置 |
afeb535
to
3cb7b26
Compare
3cb7b26
to
240dfd5
Compare
diff看着不太清楚,可以rebase压缩成一个commit吗? |
@Skyenought 或许可以分享一下你上面的压测程序,我本地再尝试一下 |
sse.zip |
看起来确实没啥区别 P.S @Skyenought 你的脚本后面执行结束后可以增加一个 kill pid 的逻辑,一旦忘记手动kill的话其实就是在测之前的 server 🤓
|
那没有问题的话, 把我这个 pr 关闭吧 |
验证中,可以先保留 |
What type of PR is this?
Check the PR title.
(Optional) Translate the PR title into Chinese.
(Optional) More detailed description for this PR(en: English/zh: Chinese).
en:
zh(optional): 取消池化 NewChunkedBodyWriter
cpu 时间出现较大差异
0.7.1 和 0.6.1 版本的 hertz 进行比较, cpu 时间相差 8 倍
性能出现劣化
从上面的 wrk 压测结果看出, 0.7.1 版本的 hertz 的各项指标均出现劣化
runtime.SetFinalizer 使用的并不恰当
添加 runtime.SetFinalizer 的原意是用于兜底回收, 但实际上带来了性能劣化
https://lemire.me/blog/2023/05/19/the-absurd-cost-of-finalizers-in-go/
在上面的博客中谈到, 使用 finalizer 会显著增加对象的创建和销毁的时间,大约是不使用 finalizer 的 430 倍。他建议避免使用 finalizer,除非有非常强烈的理由
(Optional) Which issue(s) this PR fixes:
(Optional) The PR that updates user documentation: