nodejs / nodejs/performance

Node v16 vs v20/v21 regression on http perf

Open
#127 7 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
399
Forks
11
Avg merge
29m
Merged PRs (30d)
1

Description

This server:

'use strict'

const server = require('http').createServer(function (req, res) {
  res.setHeader('content-type', 'application/json; charset=utf-8')
  res.end(JSON.stringify({ hello: 'world' }))
})

server.listen(3000)

gives me around 55k req/s on v21, v20, v18, while it gives me 65k req/s in v16 and v14.

I use the following to test but you should be able to get similar results with wrk too:

autocannon -c 100 -d 5 -p 10 -W [ -c 10 -d 2 -p 2 ] localhost:3000

This might be due to #79.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided HTTP server benchmark with Node v16, v18, v20, and v21 using the listed autocannon command, then compare the results with wrk if needed. Read issue #79 for related context and identify the cause of the throughput regression; done means the regression is explained and an appropriate fix or follow-up is established.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.