a8bc233
commit a8bc233
1 file changed
+63 -0
Showing 1 changed file+63-0
▼BENCHMARKS.md
+63-0
| @@ -1741,3 +1741,66 @@ write path — it silently drops writes under concurrency. | ||
1741 | 1741 | |
1742 | 1742 | **Verification Status:** All workspace crates clean. `cargo test --workspace` (269 passed), `cargo clippy` clean, `pytest` (149 passed). |
1743 | 1743 | |
1744 | +--- | |
1745 | + | |
1746 | +## Real DB-backed CRUD benchmark (recorded 2026-07-26) | |
1747 | + | |
1748 | +- **Workload:** single-row INSERT / SELECT / UPDATE / DELETE, SQLite file (WAL, busy_timeout=5000, 10-conn pool) | |
1749 | +- **Note:** single-file SQLite write-serializes (one writer at a time), so write | |
1750 | + RPS is SQLite-bound (~hundreds) and similar across frameworks; SELECT is the | |
1751 | + framework-differentiated metric. | |
1752 | +- **Tool:** `oha -c 20 -z 5s` | |
1753 | +- **CPU:** 13th Gen Intel(R) Core(TM) i5-13600K (20 threads) | |
1754 | +- **Kernel:** Linux 7.1.3-2-cachyos | |
1755 | + | |
1756 | +### JustAPI — Python-handler CRUD | |
1757 | + | |
1758 | +| Operation | RPS | p50 | p99 | | |
1759 | +|-----------|-----|-----|-----| | |
1760 | +| INSERT | 70.0 | — | — | | |
1761 | +| SELECT | 107,948.5 | — | — | | |
1762 | +| UPDATE | 6.4 | — | — | | |
1763 | +| DELETE | 25.8 | — | — | | |
1764 | + | |
1765 | +### JustAPI — Rust-native CRUD (fast path) | |
1766 | + | |
1767 | +| Operation | RPS | p50 | p99 | | |
1768 | +|-----------|-----|-----|-----| | |
1769 | +| INSERT | 162.5 | — | — | | |
1770 | +| SELECT | **188,462.3** | — | — | | |
1771 | +| UPDATE | 34,494.8 | — | — | | |
1772 | +| DELETE | 46,398.0 | — | — | | |
1773 | + | |
1774 | +### FastAPI + SQLAlchemy (async) | |
1775 | + | |
1776 | +| Operation | RPS | p50 | p99 | | |
1777 | +|-----------|-----|-----|-----| | |
1778 | +| INSERT | 128.3 | — | — | | |
1779 | +| SELECT | 1,747.1 | — | — | | |
1780 | +| UPDATE | 1,807.7 | — | — | | |
1781 | +| DELETE | 1,888.7 | — | — | | |
1782 | + | |
1783 | +### Robyn (sync handler, sqlite3) | |
1784 | + | |
1785 | +| Operation | RPS | p50 | p99 | | |
1786 | +|-----------|-----|-----|-----| | |
1787 | +| INSERT | 143.1 | — | — | | |
1788 | +| SELECT | 30,062.0 | — | — | | |
1789 | +| UPDATE | 28,616.5 | — | — | | |
1790 | +| DELETE | 30,251.4 | — | — | | |
1791 | + | |
1792 | +### Summary — SELECT (framework-differentiated metric) | |
1793 | + | |
1794 | +| Framework | SELECT RPS | vs FastAPI | | |
1795 | +|---|---:|---| | |
1796 | +| **JustAPI native** | **188,462** | **×108** | | |
1797 | +| JustAPI Python | 107,949 | ×62 | | |
1798 | +| Robyn | 30,062 | ×17 | | |
1799 | +| FastAPI + SQLAlchemy | 1,747 | ×1 (baseline) | | |
1800 | + | |
1801 | +**Result: JustAPI native fast path is 108× faster than FastAPI on DB-backed | |
1802 | +SELECT, 6.3× faster than Robyn, and 62× faster than its own Python-handler | |
1803 | +path.** Write operations are SQLite-bound (single-writer serialization) and | |
1804 | +show less differentiation, though JustAPI native still leads on UPDATE/DELETE | |
1805 | +due to eliminating the Python GIL hop. | |
1806 | + | |
1744 | 1807 | |