Skip to content

Commit 911b502

Browse files
committed
chore: update readme
1 parent eee4a68 commit 911b502

1 file changed

Lines changed: 34 additions & 4 deletions

File tree

README.md

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,43 @@ Fast HTTP/1.1 & HTTP/1.0 parser. Powered by Zig ⚡
1515
* Never allocates and never copies.
1616
* Similar API to picohttpparser; can be swapped in smoothly.
1717

18-
## Benchmarks
18+
## Are We Fast?
1919

20-
Benchmarks can be found under [`bench/`](https://github.com/nikneym/hparse/tree/main/bench) folder, they can either be run with [hyperfine](https://github.com/sharkdp/hyperfine) or [poop](https://github.com/andrewrk/poop).
20+
Benchmarks can be found under [`bench/`](https://github.com/nikneym/hparse/tree/main/bench) folder, they can either be run with [hyperfine](https://github.com/sharkdp/hyperfine) or [POOP](https://github.com/andrewrk/poop).
2121

22-
Here are the comparison of 3 parser libraries (hparse, httparse and picohttpparser) via hyperfine, visualized by Claude 3.7 Sonnet.
22+
Here are the comparison of 3 parser libraries (hparse, httparse and picohttpparser) via POOP, visualized by Claude 4 Sonnet.
2323

24-
<img src="https://raw.githubusercontent.com/nikneym/hparse/9e1db7a0d809480d5080447cc3f087068cfde3ae/bench/bench.svg">
24+
<img src="./bench/bench.svg">
25+
26+
```
27+
Benchmark 1 (35 runs): ./picohttpparser/picohttpparser
28+
measurement mean ± σ min … max outliers delta
29+
wall_time 1.45s ± 8.78ms 1.44s … 1.49s 1 ( 3%) 0%
30+
peak_rss 1.20MB ± 11.0KB 1.14MB … 1.20MB 1 ( 3%) 0%
31+
cpu_cycles 6.16G ± 30.3M 6.13G … 6.30G 2 ( 6%) 0%
32+
instructions 34.7G ± 141 34.7G … 34.7G 1 ( 3%) 0%
33+
cache_references 11.1K ± 3.30K 7.47K … 20.5K 1 ( 3%) 0%
34+
cache_misses 6.08K ± 1.14K 3.71K … 9.26K 2 ( 6%) 0%
35+
branch_misses 13.2K ± 3.16K 10.0K … 24.1K 3 ( 9%) 0%
36+
Benchmark 2 (33 runs): ./bench-httparse/target/release/bench-httparse
37+
measurement mean ± σ min … max outliers delta
38+
wall_time 1.54s ± 33.8ms 1.51s … 1.66s 1 ( 3%) 💩+ 5.9% ± 0.8%
39+
peak_rss 1.86MB ± 28.2KB 1.79MB … 1.92MB 12 (36%) 💩+ 54.6% ± 0.9%
40+
cpu_cycles 6.53G ± 140M 6.43G … 7.03G 1 ( 3%) 💩+ 6.1% ± 0.8%
41+
instructions 25.2G ± 294 25.2G … 25.2G 0 ( 0%) ⚡- 27.4% ± 0.0%
42+
cache_references 17.0K ± 3.58K 12.5K … 26.9K 2 ( 6%) 💩+ 53.8% ± 15.1%
43+
cache_misses 9.16K ± 1.58K 6.95K … 14.0K 2 ( 6%) 💩+ 50.7% ± 11.0%
44+
branch_misses 12.4K ± 1.23K 10.4K … 15.4K 0 ( 0%) - 5.9% ± 8.9%
45+
Benchmark 3 (40 runs): ./hparse/zig-out/bin/hparse
46+
measurement mean ± σ min … max outliers delta
47+
wall_time 1.27s ± 4.63ms 1.26s … 1.28s 0 ( 0%) ⚡- 12.5% ± 0.2%
48+
peak_rss 184KB ± 0 184KB … 184KB 0 ( 0%) ⚡- 84.6% ± 0.3%
49+
cpu_cycles 5.38G ± 1.81M 5.38G … 5.39G 3 ( 8%) ⚡- 12.6% ± 0.2%
50+
instructions 8.01G ± 164 8.01G … 8.01G 0 ( 0%) ⚡- 76.9% ± 0.0%
51+
cache_references 1.87K ± 1.24K 617 … 5.91K 3 ( 8%) ⚡- 83.1% ± 10.1%
52+
cache_misses 1.08K ± 735 469 … 3.45K 6 (15%) ⚡- 82.2% ± 7.2%
53+
branch_misses 6.51K ± 776 5.36K … 8.71K 4 (10%) ⚡- 50.6% ± 7.8%
54+
```
2555

2656
## Usage
2757

0 commit comments

Comments
 (0)