diff --git a/benchmarks/benchmark.js b/benchmarks/benchmark.js index 6a2d9e8a082..f63ece5ed16 100644 --- a/benchmarks/benchmark.js +++ b/benchmarks/benchmark.js @@ -10,7 +10,7 @@ const { Pool, Client, fetch, Agent, setGlobalDispatcher } = require('..') let nodeFetch const axios = require('axios') -const superagent = require('superagent') +let superagent let got const util = require('node:util') @@ -86,6 +86,11 @@ const requestAgent = new http.Agent({ maxSockets: connections }) +const superagentAgent = new http.Agent({ + keepAlive: true, + maxSockets: connections +}) + const undiciOptions = { path: '/', method: 'GET', @@ -337,6 +342,9 @@ async function main () { nodeFetch = _nodeFetch.default const _got = await import('got') got = _got.default + const _superagent = await import('superagent') + // https://github.com/ladjs/superagent/issues/1540#issue-561464561 + superagent = _superagent.agent().use((req) => req.agent(superagentAgent)) cronometro( experiments,