← tests

baseline

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.

testheftrequestbasewhat differs from the base
baseline.plaintext1GET /plaintext

baseline.plaintext

heft 1

base of cors.preflight

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

GET /plaintext

No body.

Expected response

HTTP 200
content-typematches /^text\/plain/

payload Hello, World!

Hello, World!

Compared byte for byte.

Test source, tests/baseline/plaintext.ts
tests/baseline/plaintext.tsopen on GitHub →
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/),
});