|
1 |
| -# api-performance-tests |
2 |
| - |
3 |
| -This is an API performance test comparing: |
4 |
| - |
| 1 | +<!-- markdownlint-disable --> |
5 | 2 | <p align="center">
|
6 |
| - <img src="https://github.com/starlite-api/branding/blob/9ab099a2089219c07727baaa29f67e9474ff93c8/assets/Starlite%20Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Light.svg#gh-light-mode-only" alt="Starlite Logo - Light" width="100%" height="auto" /> |
7 |
| - <img src="https://github.com/starlite-api/branding/blob/9ab099a2089219c07727baaa29f67e9474ff93c8/assets/Starlite%20Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Dark.svg#gh-dark-mode-only" alt="Starlite Logo - Dark" width="100%" height="auto" /> |
| 3 | + <img src="https://github.com/litestar-org/branding/blob/473f54621e55cde9acbb6fcab7fc03036173eb3d/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Light.svg#gh-light-mode-only" alt="Litestar Logo - Light" width="100%" height="auto" /> |
| 4 | + <img src="https://github.com/litestar-org/branding/blob/473f54621e55cde9acbb6fcab7fc03036173eb3d/assets/Branding%20-%20SVG%20-%20Transparent/Logo%20-%20Banner%20-%20Inline%20-%20Dark.svg#gh-dark-mode-only" alt="Litestar Logo - Dark" width="100%" height="auto" /> |
8 | 5 | </p>
|
| 6 | +<!-- markdownlint-restore --> |
| 7 | + |
| 8 | +<div align="center"> |
| 9 | + |
| 10 | +<!-- prettier-ignore-start --> |
9 | 11 |
|
10 |
| -[](https://discord.gg/X3FJqy8d2j) [](https://matrix.to/#/#starlitespace:matrix.org) [](https://reddit.com/r/starlite) |
| 12 | +| Project | | Status | |
| 13 | +|-----------|:----|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 14 | +| Community | | [](https://reddit.com/r/litestarapi) [](https://discord.gg/X3FJqy8d2j) [](https://matrix.to/#/#litestar:matrix.org) [](https://blog.litestar.dev) [](https://twitter.com/LitestarAPI) [](https://blog.litestar.dev) | |
| 15 | +| Meta | | [](https://github.com/litestar-org/litestar) [](https://spdx.org/licenses/) [](https://github.com/sponsors/litestar-org) [](https://github.com/astral-sh/ruff) [](https://github.com/psf/black) | |
11 | 16 |
|
12 |
| -1. [Starlite](https://github.com/starlite-api/starlite) |
13 |
| -2. [Starlette](https://github.com/encode/starlette) |
14 |
| -3. [FastAPI](https://github.com/tiangolo/fastapi) |
15 |
| -4. [Sanic](https://github.com/sanic-org/sanic) |
16 |
| -5. [BlackSheep](https://github.com/Neoteroi/BlackSheep) |
| 17 | +<!-- prettier-ignore-end --> |
| 18 | +</div> |
| 19 | + |
| 20 | +# api-performance-tests |
| 21 | + |
| 22 | +> **Note** |
| 23 | +> [**_Starlite has been renamed to Litestar_**](https://litestar.dev/about/organization.html#litestar-and-starlite) |
| 24 | +
|
| 25 | +This is an API performance test comparing: |
| 26 | +1. [Litestar](https://github.com/litestar-org/litestar) |
| 27 | +2. [Starlite v1.5x](https://github.com/litestar-org/litestar/tree/v1.51) |
| 28 | +3. [Starlette](https://github.com/encode/starlette) |
| 29 | +4. [FastAPI](https://github.com/tiangolo/fastapi) |
| 30 | +5. [Sanic](https://github.com/sanic-org/sanic) |
| 31 | +6. [BlackSheep](https://github.com/Neoteroi/BlackSheep) |
17 | 32 |
|
18 | 33 | Using the [bombardier](https://github.com/codesenberg/bombardier) HTTP benchmarking tool.
|
19 | 34 |
|
@@ -60,7 +75,7 @@ Serializing a dictionary into JSON
|
60 | 75 |
|
61 | 76 | ##### Serialization
|
62 | 77 |
|
63 |
| -(only supported by `Starlite` and `FastAPI`) |
| 78 | +(only supported by `Litestar` and `FastAPI`) |
64 | 79 |
|
65 | 80 | - Serializing 50 dataclass objects each referencing 2 more dataclass objects
|
66 | 81 | - Serializing 100 dataclass objects each referencing 5 more dataclass objects
|
@@ -90,8 +105,8 @@ All responses return "No Content"
|
90 | 105 | (not supported by `Starlette`)
|
91 | 106 |
|
92 | 107 | - Resolving 3 nested synchronous dependencies
|
93 |
| -- Resolving 3 nested asynchronous dependencies (only supported by `Starlite` and `FastAPI`) |
94 |
| -- Resolving 3 nested synchronous, and 3 nested asynchronous dependencies (only supported by `Starlite` and `FastAPI`) |
| 108 | +- Resolving 3 nested asynchronous dependencies (only supported by `Litestar` and `FastAPI`) |
| 109 | +- Resolving 3 nested synchronous, and 3 nested asynchronous dependencies (only supported by `Litestar` and `FastAPI`) |
95 | 110 |
|
96 | 111 | #### Modifying responses
|
97 | 112 |
|
@@ -120,25 +135,25 @@ After the run, the results will be stored in `results/run_<run_mumber>.json`
|
120 | 135 |
|
121 | 136 | To select a framework, simply pass its name to the `run command`:
|
122 | 137 |
|
123 |
| -`bench run --rps starlite starlette fastapi` |
| 138 | +`bench run --rps litestar starlette fastapi` |
124 | 139 |
|
125 | 140 | ##### Selecting a framework version
|
126 | 141 |
|
127 |
| -- A version available on PyPi: `bench run --rps starlite@v1.40.0` |
128 |
| -- A version from git: `bench run --rps starlite@git+branch_or_tag_name` |
129 |
| -- A version from a specific git repository: `bench run --rps starlite@git+https://github.com/starlite-api/starlite.git@branch_or_tag_name` |
130 |
| -- A local file: `bench run --rps starlite@file+/path/to/starlite` |
| 142 | +- A version available on PyPi: `bench run --rps litestar@v1.40.0` |
| 143 | +- A version from git: `bench run --rps litestar@git+branch_or_tag_name` |
| 144 | +- A version from a specific git repository: `bench run --rps litestar@git+https://github.com/litestar-org/litestar.git@branch_or_tag_name` |
| 145 | +- A local file: `bench run --rps litestar@file+/path/to/litestar` |
131 | 146 |
|
132 | 147 | #### Running a specific test
|
133 | 148 |
|
134 | 149 | You can run a single test by specifying its full name and category:
|
135 | 150 |
|
136 |
| -`bench run --rps starlite -t json:json-1K` |
| 151 | +`bench run --rps litestar -t json:json-1K` |
137 | 152 |
|
138 | 153 | #### Test Settings
|
139 | 154 |
|
140 | 155 | | | |
|
141 |
| -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | |
| 156 | +|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------| |
142 | 157 | | -r, --rebuild | rebuild docker images |
|
143 | 158 | | -L, --latency | run latency tests |
|
144 | 159 | | -R, --rps | run RPS tests |
|
|
0 commit comments