MCPcopy
hub / github.com/nestjs/nest / main

Function main

tools/benchmarks/src/main.ts:307–339  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

305}
306
307async 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
341main().catch(err => {
342 // eslint-disable-next-line no-console

Callers 1

main.tsFile · 0.85

Calls 4

parseArgsFunction · 0.85
runOneFunction · 0.85
printComparisonFunction · 0.85
sleepFunction · 0.70

Tested by

no test coverage detected