()
| 305 | } |
| 306 | |
| 307 | async function main(): Promise<void> { |
| 308 | const args = parseArgs(process.argv.slice(2)); |
| 309 | |
| 310 | const targets: Framework[] = [ |
| 311 | 'express', |
| 312 | 'nest-express', |
| 313 | 'fastify', |
| 314 | 'nest-fastify', |
| 315 | ]; |
| 316 | |
| 317 | const results: Partial<Record<Framework, BenchmarkSummary>> = {}; |
| 318 | |
| 319 | // Run sequentially to avoid port conflicts (both frameworks listen on the same port). |
| 320 | for (const fw of targets) { |
| 321 | results[fw] = await runOne(fw, args); |
| 322 | // small cooldown between runs |
| 323 | await sleep(250); |
| 324 | } |
| 325 | |
| 326 | // Compare raw framework vs Nest adapter for same underlying HTTP server |
| 327 | printComparison( |
| 328 | 'EXPRESS', |
| 329 | results['express'], |
| 330 | 'NEST-EXPRESS', |
| 331 | results['nest-express'], |
| 332 | ); |
| 333 | printComparison( |
| 334 | 'FASTIFY', |
| 335 | results['fastify'], |
| 336 | 'NEST-FASTIFY', |
| 337 | results['nest-fastify'], |
| 338 | ); |
| 339 | } |
| 340 | |
| 341 | main().catch(err => { |
| 342 | // eslint-disable-next-line no-console |
no test coverage detected