From 38392f67e7650a429402b5205ae4005cf461f508 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Fri, 16 Oct 2026 10:11:07 +0200 Subject: [PATCH 1/2] chore(adonisjs): update to @adonisjs/http-server 9.3 @adonisjs/http-server 9.x expects @boringnode/encryption as a peer dependency instead of @adonisjs/encryption. Switch the benchmark to it with the chacha20poly1305 driver, following the upstream benchmark. Also serialize JSON responses with JSON.stringify, as the upstream benchmark does, so AdonisJS uses the same serializer as most other frameworks here. Related https://github.com/adonisjs/http-server/blob/9.x/benchmarks/adonisjs.js --- benchmarks/adonisjs.mjs | 13 ++++++++++--- package.json | 6 +++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/benchmarks/adonisjs.mjs b/benchmarks/adonisjs.mjs index c7a6a479..842f367b 100644 --- a/benchmarks/adonisjs.mjs +++ b/benchmarks/adonisjs.mjs @@ -2,7 +2,8 @@ import { createServer } from 'node:http' import { defineConfig, Server } from '@adonisjs/http-server' import { Logger } from '@adonisjs/logger' import { Emitter } from '@adonisjs/events' -import { Encryption } from '@adonisjs/encryption' +import { Encryption } from '@boringnode/encryption' +import { chacha20poly1305 } from '@boringnode/encryption/drivers/chacha20_poly1305' import { Application } from '@adonisjs/application' const app = new Application(new URL('./', import.meta.url), { @@ -12,14 +13,20 @@ const app = new Application(new URL('./', import.meta.url), { await app.init() -const encryption = new Encryption({ secret: 'averylongrandom32charslongsecret' }) +const encryption = new Encryption( + chacha20poly1305({ id: 'app', keys: ['averylongrandom32charslongsecret'] }) +) const server = new Server( app, encryption, new Emitter(app), new Logger({ enabled: false }), - defineConfig({}) + defineConfig({ + serializeJSON (v) { + return JSON.stringify(v) + } + }) ) server.getRouter().get('/', (ctx) => { diff --git a/package.json b/package.json index f1ef2681..47211b08 100644 --- a/package.json +++ b/package.json @@ -34,11 +34,11 @@ }, "license": "MIT", "dependencies": { - "@adonisjs/application": "^9.0.1", - "@adonisjs/encryption": "^6.0.2", + "@adonisjs/application": "^9.1.0", "@adonisjs/events": "^10.2.0", - "@adonisjs/http-server": "^9.1.0", + "@adonisjs/http-server": "^9.3.1", "@adonisjs/logger": "^7.1.1", + "@boringnode/encryption": "^1.0.1", "@elysia/node": "^1.4.5", "@hapi/hapi": "^21.1.0", "@hono/node-server": "^2.0.1", From 2104a4668bb63fc2543e9a32359e5bee174b5f70 Mon Sep 17 00:00:00 2001 From: Romain Lanz Date: Fri, 16 Oct 2026 14:41:13 +0200 Subject: [PATCH 2/2] perf(adonisjs): use the tree route matcher @adonisjs/http-server 9.3 defaults to the linear route matcher. Opt into the tree matcher, which AdonisJS ships as an alternative router implementation, so the benchmark measures it instead. --- benchmarks/adonisjs.mjs | 1 + 1 file changed, 1 insertion(+) diff --git a/benchmarks/adonisjs.mjs b/benchmarks/adonisjs.mjs index 842f367b..439b4f42 100644 --- a/benchmarks/adonisjs.mjs +++ b/benchmarks/adonisjs.mjs @@ -23,6 +23,7 @@ const server = new Server( new Emitter(app), new Logger({ enabled: false }), defineConfig({ + router: { matcher: 'tree' }, serializeJSON (v) { return JSON.stringify(v) }