2022-01-24 16:03:08 +01:00
|
|
|
# HTTPie Benchmarking Infrastructure
|
2022-01-24 16:03:41 +01:00
|
|
|
|
2022-01-24 16:04:30 +01:00
|
|
|
This directory includes the benchmarks we
|
|
|
|
use for testing HTTPie's speed and the infrastructure
|
|
|
|
to automate this testing accross versions.
|
|
|
|
|
2022-01-24 16:05:49 +01:00
|
|
|
## Usage
|
|
|
|
|
2022-01-24 16:11:09 +01:00
|
|
|
Ensure the following requirements are satisfied:
|
2022-01-24 16:05:49 +01:00
|
|
|
- Python 3.7+
|
|
|
|
- `pyperf`
|
2022-01-24 16:04:30 +01:00
|
|
|
|
2022-01-24 16:11:09 +01:00
|
|
|
Then, run the `extras/benchmarks/run.py`:
|
|
|
|
```
|
|
|
|
$ python extras/profiling/run.py
|
|
|
|
```
|
|
|
|
|
|
|
|
Without any options, this command will initially create
|
|
|
|
an isolated environment and install `httpie` from the
|
|
|
|
latest commit. Then it will create a second environment
|
|
|
|
with the `master` of the current repository and run the
|
|
|
|
benchmarks on both of them. It will compare the results
|
|
|
|
and print it as a markdown table:
|
|
|
|
|
|
|
|
| Benchmark | master | this_branch |
|
|
|
|
|----------------------------------------|:------:|:--------------------:|
|
|
|
|
| `http --version` (startup) | 201 ms | 174 ms: 1.16x faster |
|
|
|
|
| `http --offline pie.dev/get` (startup) | 200 ms | 174 ms: 1.15x faster |
|
|
|
|
| Geometric mean | (ref) | 1.10x faster |
|
|
|
|
|
2022-01-24 16:11:53 +01:00
|
|
|
If your `master` branch is not up-to-date, you can get
|
|
|
|
a fresh clone by passing `--fresh` option. This way,
|
|
|
|
the benchmark runner will clone the `httpie/httpie` repo
|
|
|
|
from `GitHub` and use it as the baseline.
|