Fastro v1.0.0: High Performance by Design
We are thrilled to announce the release of Fastro v1.0.0. This version represents a significant milestone in our quest to build the fastest, most developer-friendly web framework for Deno.
Starting with v1.0.0, Fastro shifts to a robust class-based architecture while maintaining its ultra-lean core. This version is the result of a total revamp and a unique collaboration with Gemini AI, ensuring every line of code is optimized for both humans and machines.
Performance: ~99.0% of Native
The primary goal of Fastro is to provide a high-level API without the "framework
tax." Our latest benchmarks (see benchmark) show that Fastro maintains
approximately 99.0% of native Deno.serve performance in the simple root
scenario, achieving 65,389 requests per second with an average latency of
1.43ms. Results vary by workload (see the benchmark table for per-scenario
numbers). We achieved these results through several key technical decisions:
1. Zero-Dependency Core & 100% Coverage
Fastro is built strictly on Deno standards. By avoiding a heavy tree of external dependencies, we keep the startup time near-instant and the runtime overhead minimal. This release also marks a milestone in stability: 100% test coverage across the entire core.
2. Intelligent LRU Caching
Routing and static asset delivery are often the bottlenecks in web frameworks. Fastro uses an intelligent Least Recently Used (LRU) cache for both:
- Route Matching: Once a path is matched, the result is cached. Subsequent
requests bypass expensive regex and
URLPatternexecutions. - Static Assets: In production, the
staticFilesmiddleware can be configured to keep frequently accessed assets in a memory-optimized LRU buffer, ensuring near-zero disk I/O.
3. Lazy Parsing & Zero-Copy Context
We don't parse what you don't use. Core objects like ctx.url and ctx.query
are implemented as lazy-loaded getters. If your handler doesn't touch the
query parameters, Fastro never spends cycles parsing the search string.
Additionally, the context flows through middleware with minimal allocations.
Developer Experience: Modern Tooling
Fastro v1.0.0 features a first-class developer experience with features that matter:
- Hot Module Replacement (HMR): The built-in React render middleware includes a WebSocket-based HMR engine that reloads your page instantly upon changes.
- Tailwind CSS Integration: First-class support for on-the-fly Tailwind generation, making styling a breeze.
- Deno KV First: A dedicated KV middleware that injects the Deno KV instance directly into your request context.
Developer Experience: Class-Based API
In response to community feedback, v1.0.0 introduces a familiar class-based constructor:
import Fastro from "https://deno.land/x/fastro/mod.ts";
const app = new Fastro();
app.get("/", () => "Hello World");
app.serve();This pattern provides better IDE discoverability and allows for multiple isolated server instances within the same process.
Built for Scale
Fastro isn't just for "Hello World" apps. We've included advanced features for large-scale applications:
- Modular Routing: Group routes using
createRouter()and mount them as sub-applications with their own isolated middleware. - Automatic Module Loading: Turn your folder structure into a production app
automatically with
autoRegisterModules. It handles route registration for you based on yourmanifest.ts. - Rich Middleware Ecosystem:
jwt: Integrated authentication.kv: Deno KV-ready context.staticFiles: High-performance asset server with SPA fallback.bodyParser: Intelligent parsing for JSON, URL-encoded, and multipart.
- Flexible Context: A unified
ctxobject that handles state, cookies, and rendering with ease.
What's Next?
We are just getting started. v1.0.0 is our stable foundation. In the coming months, we'll be focusing on expanding our built-in middleware ecosystem and improving our documentation and tutorials.
Thank you to everyone who contributed to the journey!