JSON Processing

The JSON Processing profile measures how efficiently a framework handles a typical real-world API workload: loading data, computing derived fields, and serializing a JSON response.

How it works

  1. At startup, the server reads /data/dataset.json — a file containing 50 items with mixed types (strings, numbers, booleans, arrays, nested objects)
  2. On each GET /json request, the server:
    • Iterates all 50 items
    • Computes a total field (price × quantity) for each item
    • Builds the response object
    • Serializes everything as JSON (~10 KB response)
  3. Returns Content-Type: application/json

What it measures

  • Object allocation — 50 new objects built per request
  • JSON serialization — converting native data structures to JSON text
  • Mixed-type handling — strings, numbers, booleans, arrays, nested objects
  • Framework response overhead — buffering, headers, content-type handling

Dataset format

Each item in dataset.json:

{
  "id": 1,
  "name": "Alpha Widget",
  "category": "electronics",
  "price": 29.99,
  "quantity": 5,
  "active": true,
  "tags": ["fast", "new"],
  "rating": {
    "score": 4.2,
    "count": 127
  }
}

Expected response

{
  "items": [
    {
      "id": 1,
      "name": "Alpha Widget",
      "category": "electronics",
      "price": 29.99,
      "quantity": 5,
      "active": true,
      "tags": ["fast", "new"],
      "rating": { "score": 4.2, "count": 127 },
      "total": 149.95
    }
  ],
  "count": 50
}

Parameters

ParameterValue
EndpointGET /json
Connections4,096, 16,384, 32,768
Pipeline1
Duration5s
Runs3 (best taken)
Dataset50 items, mounted at /data/dataset.json