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

perf: use dirtmake to reduce memclr cost #1314

Merged
merged 1 commit into from May 23, 2024
Merged

Conversation

jayantxie
Copy link
Member

@jayantxie jayantxie commented Apr 1, 2024

What type of PR is this?

perf

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

perf: 使用dirtmake优化memclr开销

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:
zh(optional):

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@jayantxie jayantxie requested review from a team as code owners April 1, 2024 09:30
go.mod Outdated Show resolved Hide resolved
@jayantxie jayantxie force-pushed the perf/optimize_make_bytes branch 2 times, most recently from 871751a to 0c77eb5 Compare May 22, 2024 08:05
@jayantxie
Copy link
Member Author

jayantxie commented May 22, 2024

Before:

~/> ./scripts/benchmark_thrift.sh
Checking whether the environment meets the requirements ...
Check finished.
Building thrift services by exec build_thrift.sh ...
Build finished.
Starting server [kitex], if failed please check [output/log/nohup.log] for detail
Server [kitex] running with [ numactl -C 0,1,2,3 -m 0]
Client [kitex] running with [ numactl -C 12,13,14,15,16,17,18,19,20,21,22,23,36,37,38,39 -m 1]
Info: [KITEX] start benching [2024-05-22 20:08:48.221844203 +0800 CST m=+0.797783407], concurrent: 100, total: 3000000, sleep: 0
Info: [KITEX]: finish benching [2024-05-22 20:09:11.351526226 +0800 CST m=+23.927465435], took 23129 ms for 3000000 requests
Info: [KITEX]: requests total: 3000000, failed: 0
Info: [KITEX]: TPS: 129703.82, TP99: 2.17ms, TP999: 11.16ms (b=10240 Byte, c=100, n=3000000)
[KITEX@Server] CPU Usage: MIN: 373.83%, TP50: 388.67%, TP90: 391.96%, TP99: 392.39%, MAX: 392.61%, AVG:388.84%
[KITEX@Server] Mem Usage: AVG: 67 MB, MAX: 71 MB
[KITEX@Client] CPU Usage: MIN: 498.00%, TP50: 507.51%, TP90: 511.00%, TP99: 514.85%, MAX: 515.52%, AVG:507.32%
[KITEX@Client] Mem Usage: AVG: 93 MB, MAX: 133 MB
image

After:

~/> ./scripts/benchmark_thrift.sh
Checking whether the environment meets the requirements ...
Check finished.
Building thrift services by exec build_thrift.sh ...
Build finished.
Starting server [kitex], if failed please check [output/log/nohup.log] for detail
Server [kitex] running with [ numactl -C 0,1,2,3 -m 0]
Client [kitex] running with [ numactl -C 12,13,14,15,16,17,18,19,20,21,22,23,36,37,38,39 -m 1]
Info: [KITEX] start benching [2024-05-22 20:09:50.87681807 +0800 CST m=+0.763075252], concurrent: 100, total: 3000000, sleep: 0
Info: [KITEX]: finish benching [2024-05-22 20:10:12.58053603 +0800 CST m=+22.466793212], took 21703 ms for 3000000 requests
Info: [KITEX]: requests total: 3000000, failed: 0
Info: [KITEX]: TPS: 138225.49, TP99: 2.10ms, TP999: 11.60ms (b=10240 Byte, c=100, n=3000000)
[KITEX@Server] CPU Usage: MIN: 366.34%, TP50: 390.17%, TP90: 393.18%, TP99: 393.33%, MAX: 393.39%, AVG:389.48%
[KITEX@Server] Mem Usage: AVG: 72 MB, MAX: 78 MB
[KITEX@Client] CPU Usage: MIN: 445.00%, TP50: 510.00%, TP90: 515.00%, TP99: 516.00%, MAX: 518.89%, AVG:507.72%
[KITEX@Client] Mem Usage: AVG: 86 MB, MAX: 93 MB
image

Approximately 6.5% improvement in benchmark throughput at 10kb packages.

HeyJavaBean
HeyJavaBean previously approved these changes May 22, 2024
ppzqh
ppzqh previously approved these changes May 22, 2024
pkg/mem/span.go Show resolved Hide resolved
@jayantxie jayantxie dismissed stale reviews from ppzqh and HeyJavaBean via a92fce9 May 23, 2024 03:56
@jayantxie jayantxie merged commit 581cc2e into develop May 23, 2024
36 checks passed
@jayantxie jayantxie deleted the perf/optimize_make_bytes branch May 23, 2024 06:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants