cloudflare / cloudflare/quiche
Fix time consuming error without --dump-response argument
- Dominant language
- Rust
- Stars
- 11.8k
- Forks
- 1.1k
- Avg merge
- 21h 9m
- Merged PRs (30d)
- 6
Description
HI Cloudflare Team.
## Related
This issue related with #2200
## Description
When we don't use `--dump-response` overall time delays because of copying & converting types into String.
So I this issue fixes error by writing stdout even if we do not use `--dump-response`.
## Error Reproduce
Make dump file
```sh
dd if=/dev/zero of=/tmp/1GB.bin bs=1M count=1024
```
Open the server
```sh
cargo run --bin quiche-server -- \
--listen 127.0.0.1:4433 \
--cert apps/src/bin/cert.crt \
--key apps/src/bin/cert.key \
--root /tmp
```
Request with --dump-response
```sh
time cargo run --bin quiche-client -- \
https://127.0.0.1:4433/1GB.bin --no-verify \
--dump-responses /tmp
```
Request without --dump-response
```sh
time cargo run --bin quiche-client -- \
https://127.0.0.1:4433/1GB.bin --no-verify
```
===
We can check it takes more time when not using `--dump-response`
```sh
time cargo run --bin quiche-client -- \
https://127.0.0.1:4433/1GB.bin --no-verify
Compiling quiche_apps v0.1.0 (/Users/ohyeong-geun/rust/quiche/apps)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.54s
Running `target/debug/quiche-client 'https://127.0.0.1:4433/1GB.bin' --no-verify`
cargo run --bin quiche-client -- https://127.0.0.1:4433/1GB.bin --no-verify 5.43s user 8.30s system 81% cpu 16.792 total
```
```sh
time cargo run --bin quiche-client -- \
https://127.0.0.1:4433/1GB.bin --no-verify \
--dump-responses /tmp
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.27s
Running `target/debug/quiche-client 'https://127.0.0.1:4433/1GB.bin' --no-verify --dump-responses /tmp`
cargo run --bin quiche-client -- https://127.0.0.1:4433/1GB.bin --no-verify 0.15s user 0.08s system 31% cpu 0.729 total
```
Contributor guide
Assessment
This issue has not been assessed yet.