docs: fix landing page terminal styling, add Robyn comparison data

swadhinbiswas committed 3 months ago
118dc27
1 parent 03fa05f
commit 118dc27
1 file changed
+20 -22
Showing 1 changed file+20-22
▼docs_site/src/content/docs/index.mdx
+20-22
19
19
20
20
import { Card, CardGrid } from '@astrojs/starlight/components';
21
21
22
-<div class="hero-comparison">
22
+## Performance
23
23
24
-| | FastAPI | JustAPI |
25
-|---|---|---|
26
-| **Requests/sec** | 36,189 | **701,234** |
27
-| **p99 latency** | 24.63 ms | **0.19 ms** |
28
-| **Networking** | Python (uvicorn) | **Rust (hyper + tokio)** |
29
-| **TLS** | OpenSSL | **rustls (Rust)** |
30
-| **GIL** | Blocks I/O | **Released in Rust** |
31
-| **Syntax** | `from fastapi import FastAPI` | `from justapi import JustAPIApp` |
24
+| Framework | Requests/sec | p50 Latency | p99 Latency |
25
+|---|--:|--:|--:|
26
+| **JustAPI (native fast path)** | **701,234** | **0.07 ms** | **0.19 ms** |
27
+| **JustAPI (Python handler)** | **60,297** | **1.03 ms** | **5.21 ms** |
28
+| Robyn 0.88 | 39,103 | 1.78 ms | 11.47 ms |
29
+| Granian | 69,195 | 0.72 ms | 3.87 ms |
30
+| FastAPI + Uvicorn | 36,189 | 1.72 ms | 24.63 ms |
32
31
33
-</div>
34
-
35
-*Same decorators. Same Pydantic models. Same dependency injection. 20× faster.*
32
+All measurements on the same hardware (i5-13600K, 20 threads), 100 concurrent connections, 30s duration.
36
33
37
34
## What It Does
38
35
39
36
JustAPI runs your Python application logic on top of a Rust networking stack. Routing, TLS, serialization, compression — all handled in Rust before your code even runs.
40
37
41
-```python
38
+```python title="main.py"
42
39
from justapi import JustAPIApp
43
40
44
41
app = JustAPIApp()
48
45
return {"message": "Hello from JustAPI!"}
49
46
```
50
47
51
-```bash
52
-pip install justapi
53
-python main.py
54
-# → http://127.0.0.1:8000/docs
48
+```bash title="Terminal"
49
+$ pip install justapi
50
+$ python main.py
51
+
52
+INFO: JustAPI running on http://127.0.0.1:8000
55
53
```
56
54
57
-Open the `/docs` endpoint and you get Swagger UI, ReDoc, and the full OpenAPI schema — generated automatically from your code.
55
+Open `/docs` for Swagger UI, `/redoc` for ReDoc, and the full OpenAPI schema — generated automatically from your code.
58
56
59
57
## Features
60
58
81
79
82
80
## Install
83
81
84
-```bash
85
-pip install justapi # pip
86
-uv pip install justapi # uv (recommended)
87
-uvx justapi create my_app # scaffold without installing
82
+```bash title="Terminal"
83
+$ pip install justapi
84
+$ uv pip install justapi
85
+$ uvx justapi create my_app
88
86
```
89
87
90
88
## Learn
91
89