chopin: simplify benchmark to JSON and plaintext only#10789
chopin: simplify benchmark to JSON and plaintext only#10789msmith-techempower merged 10 commits intoTechEmpower:masterfrom
Conversation
- Remove all database-related handlers (/db, /queries, /fortunes, /updates, /cached-queries) - Use FastRoute zero-allocation endpoints for /json and /plaintext only - Remove DB dependencies: sea-orm, yarte, rand, serde, bytes - Remove template files and common helpers - Update config to disable database - Remove config.toml (superseded by benchmark_config.json) Follows Chopin tutorial: FastRoute is optimized for static endpoints (~35ns per request). Result: +5-16% JSON throughput, +13-23% plaintext throughput vs Axum.
|
Please add yourself to the maintainers in the So with any change or marked as broken, you will be notified. Example: |
…per TFB spec - Update chopin-core to latest (0.3.4) - Add serde/serde_json dependencies - Implement /json handler with per-request serialization (required by TFB) - Keep /plaintext as FastRoute (allowed by TFB plaintext spec) - Comply with TFB JSON Serialization test requirement xiv: "The serialization to JSON must not be cached; the computational effort to serialize an object to JSON must occur within the scope of handling each request."
…Router for per-request headers
…s, remove axum imports
…computes headers per-request)
|
What changed now, than FastRoute don't cache ?? |
|
Please don't use the time and energy from other people, if you later change it again the FastRoute !!! |
The original idea behind designing fastroute was to implement a health check without loading any middleware, as well as to serve static files, in order to reduce the system load. Another benefit is that it allows us to isolate certain APIs that need to be extremely lightweight. That's why we kept the option to enable cache headers if needed. I apologize for the multiple revisions; I got a bit confused with how the plaintext caching was handled. |
No, FastRoute does not cache routes by default. |
Add Chopin Framework Benchmark
Overview
Adds a benchmark implementation for Chopin v0.3.3 web framework to TFB.
Implementation
/jsonand/plaintextusing Chopin'sFastRoutezero-allocation routerchopin-corev0.2.1 (withperffeature)axum(HTTP layer)tokio(async runtime)Design
Focuses on static response endpoints (FastRoute) rather than full CRUD because:
Files