-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
C++: HTTP server and client #6
Conversation
Fix server: missing |
Poop bench: https://github.com/andrewrk/poop -hyperfine -i "${args[@]}" "${commands[@]}" --export-json benchmarks.json --export-markdown benchmarks.md
-sed -i "s|$cpwd\/||g" benchmarks.*
+poop "${commands[@]}" Running the server...
Benchmark 1 (3 runs): curl http://127.0.0.1:8000/get?[1-1000]
measurement mean ± σ min … max outliers delta
wall_time 402ms ± 6.23ms 395ms … 407ms 0 ( 0%) 0%
peak_rss 8.39MB ± 0 8.39MB … 8.39MB 0 ( 0%) 0%
cpu_cycles 246M ± 2.50M 244M … 249M 0 ( 0%) 0%
instructions 235M ± 16.8K 235M … 235M 0 ( 0%) 0%
cache_references 16.4M ± 219K 16.3M … 16.6M 0 ( 0%) 0%
cache_misses 7.62M ± 165K 7.49M … 7.80M 0 ( 0%) 0%
branch_misses 4.34M ± 88.8K 4.29M … 4.45M 0 ( 0%) 0%
Benchmark 2 (3 runs): /home/kassane/zig-http-benchmarks/zig-http-client/zig-out/bin/zig-http-client
measurement mean ± σ min … max outliers delta
wall_time 156ms ± 667us 155ms … 156ms 0 ( 0%) ⚡- 61.3% ± 2.5%
peak_rss 655KB ± 0 655KB … 655KB 0 ( 0%) ⚡- 92.2% ± 0.0%
cpu_cycles 18.4M ± 264K 18.2M … 18.7M 0 ( 0%) ⚡- 92.5% ± 1.6%
instructions 16.1M ± 993 16.1M … 16.1M 0 ( 0%) ⚡- 93.1% ± 0.0%
cache_references 2.25M ± 33.6K 2.21M … 2.28M 0 ( 0%) ⚡- 86.3% ± 2.2%
cache_misses 716K ± 9.31K 706K … 725K 0 ( 0%) ⚡- 90.6% ± 3.5%
branch_misses 154K ± 6.05K 150K … 161K 0 ( 0%) ⚡- 96.4% ± 3.3%
Benchmark 3 (3 runs): /home/kassane/zig-http-benchmarks/rust-attohttpc/target/release/rust-attohttpc
measurement mean ± σ min … max outliers delta
wall_time 145ms ± 1.09ms 144ms … 146ms 0 ( 0%) ⚡- 63.9% ± 2.5%
peak_rss 2.58MB ± 75.7KB 2.49MB … 2.62MB 0 ( 0%) ⚡- 69.3% ± 1.4%
cpu_cycles 31.1M ± 623K 30.6M … 31.8M 0 ( 0%) ⚡- 87.4% ± 1.7%
instructions 29.5M ± 10.3K 29.5M … 29.5M 0 ( 0%) ⚡- 87.5% ± 0.0%
cache_references 4.07M ± 14.9K 4.05M … 4.08M 0 ( 0%) ⚡- 75.2% ± 2.1%
cache_misses 2.35M ± 39.1K 2.30M … 2.37M 0 ( 0%) ⚡- 69.2% ± 3.6%
branch_misses 313K ± 11.1K 302K … 325K 0 ( 0%) ⚡- 92.8% ± 3.3%
Benchmark 4 (3 runs): /home/kassane/zig-http-benchmarks/rust-hyper/target/release/rust-hyper
measurement mean ± σ min … max outliers delta
wall_time 92.0ms ± 2.07ms 90.3ms … 94.3ms 0 ( 0%) ⚡- 77.1% ± 2.6%
peak_rss 2.71MB ± 75.7KB 2.62MB … 2.75MB 0 ( 0%) ⚡- 67.7% ± 1.4%
cpu_cycles 32.6M ± 430K 32.3M … 33.1M 0 ( 0%) ⚡- 86.7% ± 1.7%
instructions 33.4M ± 13.5K 33.4M … 33.4M 0 ( 0%) ⚡- 85.8% ± 0.0%
cache_references 5.21M ± 77.5K 5.16M … 5.30M 0 ( 0%) ⚡- 68.2% ± 2.3%
cache_misses 1.75M ± 61.7K 1.70M … 1.82M 0 ( 0%) ⚡- 77.0% ± 3.7%
branch_misses 267K ± 14.2K 254K … 282K 0 ( 0%) ⚡- 93.8% ± 3.3%
Benchmark 5 (3 runs): /home/kassane/zig-http-benchmarks/rust-reqwest/target/release/rust-reqwest
measurement mean ± σ min … max outliers delta
wall_time 105ms ± 3.90ms 102ms … 110ms 0 ( 0%) ⚡- 73.8% ± 2.9%
peak_rss 3.71MB ± 75.7KB 3.67MB … 3.80MB 0 ( 0%) ⚡- 55.7% ± 1.4%
cpu_cycles 51.6M ± 558K 51.2M … 52.2M 0 ( 0%) ⚡- 79.0% ± 1.7%
instructions 45.2M ± 128K 45.1M … 45.3M 0 ( 0%) ⚡- 80.8% ± 0.1%
cache_references 7.52M ± 107K 7.40M … 7.60M 0 ( 0%) ⚡- 54.1% ± 2.4%
cache_misses 3.75M ± 80.0K 3.69M … 3.84M 0 ( 0%) ⚡- 50.8% ± 3.8%
branch_misses 520K ± 26.6K 497K … 549K 0 ( 0%) ⚡- 88.0% ± 3.4%
Benchmark 6 (3 runs): /home/kassane/zig-http-benchmarks/rust-ureq/target/release/rust-ureq
measurement mean ± σ min … max outliers delta
wall_time 90.4ms ± 1.61ms 89.0ms … 92.2ms 0 ( 0%) ⚡- 77.5% ± 2.6%
peak_rss 2.62MB ± 0 2.62MB … 2.62MB 0 ( 0%) ⚡- 68.8% ± 0.0%
cpu_cycles 21.2M ± 267K 21.0M … 21.5M 0 ( 0%) ⚡- 91.4% ± 1.6%
instructions 30.3M ± 2.73K 30.3M … 30.3M 0 ( 0%) ⚡- 87.1% ± 0.0%
cache_references 2.64M ± 27.3K 2.61M … 2.66M 0 ( 0%) ⚡- 83.9% ± 2.2%
cache_misses 846K ± 17.6K 833K … 866K 0 ( 0%) ⚡- 88.9% ± 3.5%
branch_misses 145K ± 3.49K 142K … 148K 0 ( 0%) ⚡- 96.7% ± 3.3%
Benchmark 7 (3 runs): /home/kassane/zig-http-benchmarks/cpp-asio-httpclient/zig-out/bin/cpp-asio-httpclient
measurement mean ± σ min … max outliers delta
wall_time 178ms ± 2.86ms 175ms … 181ms 0 ( 0%) ⚡- 55.7% ± 2.7%
peak_rss 5.15MB ± 79.5KB 5.10MB … 5.24MB 0 ( 0%) ⚡- 38.6% ± 1.5%
cpu_cycles 64.1M ± 510K 63.6M … 64.6M 0 ( 0%) ⚡- 73.9% ± 1.7%
instructions 47.8M ± 138 47.8M … 47.8M 0 ( 0%) ⚡- 79.7% ± 0.0%
cache_references 8.11M ± 92.9K 8.02M … 8.21M 0 ( 0%) ⚡- 50.5% ± 2.3%
cache_misses 3.46M ± 34.4K 3.43M … 3.49M 0 ( 0%) ⚡- 54.5% ± 3.5%
branch_misses 720K ± 7.96K 711K … 725K 0 ( 0%) ⚡- 83.4% ± 3.3%
Benchmark 8 (3 runs): /home/kassane/zig-http-benchmarks/go-http-client/go-http-client
measurement mean ± σ min … max outliers delta
wall_time 125ms ± 1.94ms 123ms … 127ms 0 ( 0%) ⚡- 68.9% ± 2.6%
peak_rss 15.8MB ± 579KB 15.2MB … 16.2MB 0 ( 0%) 💩+ 88.6% ± 11.1%
cpu_cycles 90.3M ± 3.82M 86.7M … 94.3M 0 ( 0%) ⚡- 63.3% ± 3.0%
instructions 82.5M ± 839K 81.6M … 83.2M 0 ( 0%) ⚡- 64.9% ± 0.6%
cache_references 10.3M ± 80.8K 10.3M … 10.4M 0 ( 0%) ⚡- 37.0% ± 2.3%
cache_misses 4.08M ± 44.7K 4.03M … 4.12M 0 ( 0%) ⚡- 46.4% ± 3.6%
branch_misses 739K ± 8.60K 732K … 748K 0 ( 0%) ⚡- 83.0% ± 3.3%
Benchmark 9 (3 runs): python /home/kassane/zig-http-benchmarks/python-http-client/python-http-client.py
measurement mean ± σ min … max outliers delta
wall_time 678ms ± 5.62ms 672ms … 683ms 0 ( 0%) 💩+ 68.6% ± 3.3%
peak_rss 26.9MB ± 0 26.9MB … 26.9MB 0 ( 0%) 💩+220.3% ± 0.0%
cpu_cycles 2.30G ± 61.1M 2.24G … 2.37G 0 ( 0%) 💩+835.9% ± 39.8%
instructions 3.66G ± 1.70M 3.66G … 3.66G 0 ( 0%) 💩+1456.1% ± 1.2%
cache_references 235M ± 763K 234M … 236M 0 ( 0%) 💩+1333.3% ± 7.8%
cache_misses 44.8M ± 343K 44.4M … 45.0M 0 ( 0%) 💩+487.6% ± 8.0%
branch_misses 24.4M ± 640K 23.7M … 25.0M 0 ( 0%) 💩+460.9% ± 23.8% |
LGTM? |
updated. but detect an issue #8 during tests |
I don't get any logs on the server part while running the Also, when I |
Strange! C++ client works on C++ and Rust servers. |
Found problem at:
Fix replacing |
Worked! and Go client too. \o/ close #8 |
Great! That worked 🚀 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have much experience to review C++ code but it works well so I will go ahead and merge this. Thank you for your contribution! 🐻
cc: @orhun
Library
Updated
my host testing:
CPU: Ryzen 7 5700G
OS: ArchLinux
RAM: 12GiB
curl
zig-http-client
rust-attohttpc
rust-hyper
rust-reqwest
rust-ureq
go-http-client
python-http-client
cpp-asio-httpclient