1
0
mirror of https://github.com/httpie/cli.git synced 2025-12-26 00:31:53 +02:00
Files
httpie-cli/extras/profiling/README.md

40 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

# HTTPie Benchmarking Infrastructure
2022-01-24 18:03:41 +03:00
2022-01-24 18:20:03 +03:00
This directory includes the benchmarks we use for testing HTTPie's speed and the
infrastructure to automate this testing across versions.
2022-01-24 18:04:30 +03:00
2022-01-24 18:05:49 +03:00
## Usage
2022-01-24 18:11:09 +03:00
Ensure the following requirements are satisfied:
2022-01-24 18:05:49 +03:00
- Python 3.7+
- `pyperf`
2022-01-24 18:04:30 +03:00
2022-01-24 18:11:09 +03:00
Then, run the `extras/benchmarks/run.py`:
2022-01-24 18:16:38 +03:00
```console
2022-01-24 18:11:09 +03:00
$ python extras/profiling/run.py
```
2022-01-24 18:20:03 +03:00
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:
2022-01-24 18:11:09 +03:00
| Benchmark | master | this_branch |
| -------------------------------------- | :----: | :------------------: |
2022-01-24 18:11:09 +03:00
| `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 18:20:03 +03: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.
2022-01-24 18:11:09 +03:00
2022-01-24 18:20:03 +03:00
You can customize these branches by passing `--local-repo`/`--target-branch`,
and customize the repos by passing `--local-repo`/`--target-repo` (can either
take a URL or a path).
2022-01-24 18:14:57 +03:00
If you want to run a third environment with additional dependencies (such as
2022-01-24 18:20:03 +03:00
`pyOpenSSL`), you can pass `--complex`.