Skip to content

Commit

Permalink
benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
uchenily committed May 16, 2024
1 parent f1609a0 commit 4dce681
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ cp -r uvio xxx_path

clang (>= 17) 或 gcc (>= 13) 或 apple clang (>= 15) 或 MSVC (>= 19)

## 基准测试

[benchmark](./benchmark/benchmark.md)

## 致谢

项目设计与实现参考了以下开源项目, 在此表示感谢!
Expand Down
30 changes: 30 additions & 0 deletions benchmark/benchmark.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Benchmark

## 测试环境

cpu: Intel(R) Xeon(R) CPU E5-2660 v3 @ 2.60GHz
kernel: 6.8.8-arch1-1
gcc: (GCC) 14.1.1 20240507
wrk: 4.2.0 [epoll] Copyright (C) 2012 Will Glozer


```shell
$ date
Thu May 16 04:30:21 PM CST 2024
$ wrk -t4 -c100 -d30s --latency http://127.0.0.1:8000
Running 30s test @ http://127.0.0.1:8000
4 threads and 100 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 559.12us 191.85us 29.45ms 95.54%
Req/Sec 43.70k 3.99k 132.05k 83.85%
Latency Distribution
50% 540.00us
75% 564.00us
90% 615.00us
99% 1.09ms
5222221 requests in 30.10s, 443.25MB read
Requests/sec: 173498.54
Transfer/sec: 14.73MB
```

> 备注: 服务端单线程
File renamed without changes.
10 changes: 10 additions & 0 deletions benchmark/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cpp_benchmarks_sources = [
'benchmark_uvio.cpp',
]

foreach source: cpp_benchmarks_sources
executable(source.replace('.cpp', ''), source,
include_directories: includes,
cpp_args: compile_args,
dependencies: dependencies)
endforeach
1 change: 0 additions & 1 deletion examples/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
all_examples_sources = [
'http_server.cpp',
]

foreach source: all_examples_sources
Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ dependencies += libuv_dep

subdir('tests')
subdir('examples')
subdir('benchmark')

install_subdir('uvio', install_dir: 'include')

0 comments on commit 4dce681

Please sign in to comment.