The dispatch floor, with nothing serialised.
Comparable across every framework. It is the row the rest are read against rather than a measurement of anything on its own: a framework that is slow here is slow everywhere.
| test | heft | request | base | what differs from the base |
|---|---|---|---|---|
| baseline.plaintext | 1 | GET /plaintext |
The dispatch floor. A fixed string out, with no serialiser in the way, so what is left is the framework accepting a connection, matching a route and writing a response. Every other row in the corpus is read against this one.
GET /plaintext
No body.
HTTP 200
/^text\/plain/payload Hello, World!
Hello, World!
Compared byte for byte.
import { performanceTest, text } from "#kit";
const path = "/plaintext";
/** Written by the handler as a literal, so it is the one answer with no file in tests/payloads. */
const HELLO = text("Hello, World!", "Hello, World!");
export default performanceTest({
id: { family: "baseline", name: "plaintext" },
path,
heft: 1,
about:
"The dispatch floor. A fixed string out, with no serialiser in the way, " +
"so what is left is the framework accepting a connection, matching a " +
"route and writing a response. Every other row in the corpus is read " +
"against this one.",
request: (c) => c.get(path).okWith(HELLO).hasHeader("content-type", /^text\/plain/),
});