docs(bench): disclose charset + secure-cost scope; add typecheck:bench script

Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
chrnx committed 2026-07-06 23:17:58 -05:00
1 parent daa13f6f78
commit 7593d1425a
4 files changed
+128 -113

No files matched your search

+7
View File
@@ -147,6 +147,10 @@ function renderSecureCost(secureCost: RenderData['secureCost']): string {
'',
deltaNote,
'',
'> Scope: this micro-bench currently measures the security-**headers** cost only (`security:false` vs',
'> `security:true` on `/hello`). The incremental cost of `@body` validation and CORS is not separately',
'> measured yet (deferred) — so this table is narrower than the design spec\'s 4-point plan.',
'',
].join('\n');
}
@@ -167,6 +171,9 @@ function renderMethodology(): string {
' `JSON.stringify` in these benchmarks. Fastify\'s `fast-json-stringify` response serializer is',
' deliberately **not** engaged — only its input `schema.body` validation is used — so no framework',
' gets a serialization fast path the others lack.',
'- **Content-type charset asymmetry (disclosed, not controlled)**: green-tea and raw-http send',
' `Content-Type: application/json` while Express and Fastify send `application/json; charset=utf-8`.',
' This is a minor header-byte asymmetry that is disclosed here rather than normalized away.',
'',
].join('\n');
}
+89 -89
View File
@@ -1,7 +1,7 @@
{
"env": {
"date": "2026-07-07",
"commit": "926ca39",
"commit": "daa13f6",
"node": "v22.22.2",
"os": "darwin",
"cpu": "Apple M4 Max (16 cores)",
@@ -23,11 +23,11 @@
{
"framework": "raw-http",
"reqSec": {
"median": 115398.4,
"min": 115078.4,
"max": 116076.8,
"stddev": 416.2570146222469,
"cv": 0.003603399427582749
"median": 116166.4,
"min": 115590.4,
"max": 117241.6,
"stddev": 684.2913999167365,
"cv": 0.005882187997853885
},
"p50": 0,
"p99": 1,
@@ -36,11 +36,11 @@
{
"framework": "fastify",
"reqSec": {
"median": 85881.6,
"min": 85382.4,
"max": 86073.6,
"stddev": 291.32305092457597,
"cv": 0.0033961968743538755
"median": 86470.4,
"min": 86201.6,
"max": 86828.8,
"stddev": 256.92278130900564,
"cv": 0.0029701964075911015
},
"p50": 1,
"p99": 2,
@@ -49,24 +49,24 @@
{
"framework": "express",
"reqSec": {
"median": 24126.4,
"min": 24072,
"max": 24158.4,
"stddev": 35.66560746090835,
"cv": 0.0014787390042501193
"median": 24004.8,
"min": 23988.8,
"max": 24136,
"stddev": 65.9438144685816,
"cv": 0.002742722036525155
},
"p50": 3,
"p99": 5,
"p999": 8
"p99": 6,
"p999": 9
},
{
"framework": "green-tea",
"reqSec": {
"median": 98912,
"min": 98835.2,
"max": 99961.6,
"stddev": 513.8455626180164,
"cv": 0.005178001751557391
"median": 97760,
"min": 97094.4,
"max": 97836.8,
"stddev": 333.34655973759686,
"cv": 0.003416705658430423
},
"p50": 0,
"p99": 1,
@@ -81,11 +81,11 @@
{
"framework": "raw-http",
"reqSec": {
"median": 115436.8,
"min": 115244.8,
"max": 116012.8,
"stddev": 326.3372488699382,
"cv": 0.0028238464382747876
"median": 117024,
"min": 116537.6,
"max": 117241.6,
"stddev": 294.3072317607338,
"cv": 0.0025168575864821115
},
"p50": 0,
"p99": 1,
@@ -94,11 +94,11 @@
{
"framework": "fastify",
"reqSec": {
"median": 85804.8,
"min": 85497.6,
"max": 85856,
"stddev": 158.26975565645782,
"cv": 0.0018463688799174882
"median": 85753.6,
"min": 85651.2,
"max": 86316.8,
"stddev": 292.6323746044982,
"cv": 0.0034063777495308683
},
"p50": 1,
"p99": 2,
@@ -107,11 +107,11 @@
{
"framework": "express",
"reqSec": {
"median": 23739.2,
"min": 23694.4,
"max": 23777.6,
"stddev": 33.99973856108518,
"cv": 0.001432347940819078
"median": 23665.6,
"min": 23665.6,
"max": 23720,
"stddev": 25.64440593103281,
"cv": 0.0010827856221020677
},
"p50": 4,
"p99": 5,
@@ -120,11 +120,11 @@
{
"framework": "green-tea",
"reqSec": {
"median": 93113.6,
"min": 92947.2,
"max": 93126.4,
"stddev": 81.62613960409276,
"cv": 0.000877111912051406
"median": 92384,
"min": 91795.2,
"max": 92998.4,
"stddev": 491.24140252584004,
"cv": 0.005316895043385614
},
"p50": 1,
"p99": 2,
@@ -140,11 +140,11 @@
{
"framework": "raw-http",
"reqSec": {
"median": 114016,
"min": 114003.2,
"max": 114156.8,
"stddev": 69.58722743594919,
"cv": 0.0006101003060058202
"median": 114156.8,
"min": 113862.4,
"max": 114553.6,
"stddev": 283.21155029804993,
"cv": 0.0024801579427618002
},
"p50": 0,
"p99": 1,
@@ -153,11 +153,11 @@
{
"framework": "fastify",
"reqSec": {
"median": 83808,
"min": 83769.61,
"max": 83897.6,
"stddev": 53.62772106538676,
"cv": 0.0006397575458676833
"median": 84320,
"min": 84268.8,
"max": 84422.4,
"stddev": 63.857619400938304,
"cv": 0.0007571714540811431
},
"p50": 1,
"p99": 2,
@@ -166,11 +166,11 @@
{
"framework": "express",
"reqSec": {
"median": 23758.4,
"min": 23720,
"max": 23777.6,
"stddev": 23.946607275352836,
"cv": 0.001008193300579018
"median": 23828.8,
"min": 23768,
"max": 23851.2,
"stddev": 35.151481713672865,
"cv": 0.001475960770644645
},
"p50": 4,
"p99": 5,
@@ -179,11 +179,11 @@
{
"framework": "green-tea",
"reqSec": {
"median": 84230.4,
"min": 84179.2,
"max": 85049.6,
"stddev": 398.7907053413738,
"cv": 0.004720176328277377
"median": 83961.6,
"min": 83590.4,
"max": 84358.4,
"stddev": 313.5927436802211,
"cv": 0.0037345747973909107
},
"p50": 1,
"p99": 2,
@@ -198,11 +198,11 @@
{
"framework": "raw-http",
"reqSec": {
"median": 99014.4,
"min": 98438.4,
"max": 99180.8,
"stddev": 318.0885131881125,
"cv": 0.0032169839814651393
"median": 100230.4,
"min": 100064,
"max": 100294.4,
"stddev": 97.10768364152092,
"cv": 0.0009691746695970135
},
"p50": 0,
"p99": 1,
@@ -211,11 +211,11 @@
{
"framework": "fastify",
"reqSec": {
"median": 63868.8,
"min": 63836.8,
"max": 64323.2,
"stddev": 222.1331732692473,
"cv": 0.0034703102857891206
"median": 63222.4,
"min": 62307.2,
"max": 63228.8,
"stddev": 432.9457959401203,
"cv": 0.006880951458691962
},
"p50": 1,
"p99": 2,
@@ -224,24 +224,24 @@
{
"framework": "express",
"reqSec": {
"median": 19985.6,
"min": 19886.41,
"max": 20068.8,
"stddev": 74.55572725597027,
"cv": 0.003731467455443308
"median": 19870.41,
"min": 19758.41,
"max": 19883.2,
"stddev": 56.05565508195131,
"cv": 0.0028257646983895677
},
"p50": 4,
"p99": 7,
"p999": 26
"p999": 23
},
{
"framework": "green-tea",
"reqSec": {
"median": 76486.4,
"min": 76396.8,
"max": 76691.2,
"stddev": 123.21731480058412,
"cv": 0.0016101618664875192
"median": 76243.2,
"min": 76192,
"max": 76550.4,
"stddev": 158.26975565645782,
"cv": 0.0020735333006502306
},
"p50": 1,
"p99": 2,
@@ -254,27 +254,27 @@
{
"path": "/steps/0",
"steps": 0,
"reqSec": 92857.6
"reqSec": 91385.6
},
{
"path": "/steps/3",
"steps": 3,
"reqSec": 81657.61
"reqSec": 81529.61
},
{
"path": "/steps/5",
"steps": 5,
"reqSec": 71968
"reqSec": 72236.8
}
],
"secureCost": [
{
"label": "security:false (parity)",
"reqSec": 98912
"reqSec": 97760
},
{
"label": "security:true (default)",
"reqSec": 93177.6
"reqSec": 93305.6
}
]
}