Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions benchmarks/operations/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ const modules = [
module: "http-request",
name: "Outgoing HTTP request (`http.request`)",
},
{
module: "undici",
name: "Outgoing HTTP request (`undici.request`)",
},
];

(async () => {
Expand Down
9 changes: 2 additions & 7 deletions benchmarks/operations/http-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,8 @@ const http = require("http");
module.exports = {
step: async function step() {
return new Promise((resolve, reject) => {
const options = {
hostname: "localhost",
port: 10411,
};

const req = http.request(options, (res) => {
res.on("data", () => {});
const req = http.request("http://localhost:10411", (res) => {
res.resume();
res.on("end", resolve);
});

Expand Down
11 changes: 10 additions & 1 deletion benchmarks/operations/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion benchmarks/operations/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"dependencies": {
"@aikidosec/firewall": "file:../../build",
"better-sqlite3": "^11.7.2",
"mongodb": "^6.9.0"
"mongodb": "^6.9.0",
"undici": "^7.3.0"
}
}
7 changes: 7 additions & 0 deletions benchmarks/operations/undici.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const undici = require("undici");

module.exports = {
step: async function step() {
return await undici.request("http://localhost:10411");
},
};
Loading