Files
bun.sh/bench/snippets/http-hello.node.mjs
Jarred Sumner 3ba9647858 Fix a couple bugs with node:http (#6924)
* Update to latest SIMDUTF

* Fix issue with `Headers.toJSON` having an incorrect size set with set-cookie header

* [node:http] Fix `undefined` when multiple Set-Cookie headers are sent

* Count UTF8 byteLength for headers

This is not necessary, just being cautious.

* Update http-hello.node.mjs

* Be 100% sure the test isn't caching anything

* move this up

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-11-06 03:51:49 -08:00

13 lines
368 B
JavaScript

import { createServer } from "node:http";
var i = 0;
const server = createServer((req, res) => {
res.writeHead(200);
res.end("Hello, World!" + i);
if (i++ === 200_000 - 1)
setTimeout(() => {
console.log("RSS", (process.memoryUsage().rss / 1024 / 1024) | 0, "MB");
process.exit(0);
}, 0);
}).listen(parseInt(process.env.PORT || "3000", 10));