qhttpx 1.8.0 → 1.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.8.1] - 2026-01-20
6
+ **"The Cleanup Update"**
7
+
8
+ ### Removed
9
+ - **External Dependencies**: Removed `express` and `fastify` from dev dependencies and benchmarks to streamline the package.
10
+
5
11
  ## [1.8.0] - 2026-01-20
6
12
  **"The Full-Stack Update"**
7
13
 
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qhttpx",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "**URL:** https://qhttpx.gridrr.com",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -16,7 +16,6 @@
16
16
  "example": "npx tsx examples/api-server.ts",
17
17
  "bench": "npm run build && node dist/src/benchmarks/simple-json.js",
18
18
  "bench:quantam": "npm run build && node dist/src/benchmarks/quantam-users.js",
19
- "bench:compare": "npm run build && node dist/src/benchmarks/compare-frameworks.js",
20
19
  "bench:ultra": "npm run build && node dist/src/benchmarks/ultra-mode.js"
21
20
  },
22
21
  "keywords": [],
@@ -27,7 +26,6 @@
27
26
  "@types/autocannon": "^7.12.7",
28
27
  "@types/better-sqlite3": "^7.6.13",
29
28
  "@types/busboy": "^1.5.4",
30
- "@types/express": "^5.0.6",
31
29
  "@types/ioredis": "^4.28.10",
32
30
  "@types/mongodb": "^4.0.6",
33
31
  "@types/node": "^25.0.9",
@@ -49,9 +47,7 @@
49
47
  "dependencies": {
50
48
  "better-sqlite3": "^12.6.2",
51
49
  "busboy": "^1.6.0",
52
- "express": "^5.2.1",
53
50
  "fast-json-stringify": "^5.15.1",
54
- "fastify": "^5.7.1",
55
51
  "pino": "^10.2.0",
56
52
  "pino-pretty": "^13.1.3",
57
53
  "quantam-async": "^0.1.1",
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const autocannon_1 = __importDefault(require("autocannon"));
7
- const fastify_1 = __importDefault(require("fastify"));
8
7
  const index_1 = require("../index");
9
8
  async function runAutocannon(name, url) {
10
9
  const result = await (0, autocannon_1.default)({
@@ -56,19 +55,6 @@ async function startQHTTPXUltra() {
56
55
  const url = `http://127.0.0.1:${port}/json`;
57
56
  return { app, url };
58
57
  }
59
- async function startFastify() {
60
- const app = (0, fastify_1.default)();
61
- app.get('/json', async () => {
62
- return { message: 'hello from fastify' };
63
- });
64
- await app.listen({ port: 0, host: '127.0.0.1' });
65
- const address = app.server.address();
66
- if (!address || typeof address === 'string') {
67
- throw new Error('Fastify address not available');
68
- }
69
- const url = `http://127.0.0.1:${address.port}/json`;
70
- return { app, url };
71
- }
72
58
  async function run() {
73
59
  const results = [];
74
60
  console.log('=== QHTTPX Balanced Mode ===');
@@ -89,15 +75,6 @@ async function run() {
89
75
  finally {
90
76
  await ultra.app.close();
91
77
  }
92
- console.log('\n=== Fastify Baseline ===');
93
- const fast = await startFastify();
94
- try {
95
- const r = await runAutocannon('Fastify', fast.url);
96
- results.push(r);
97
- }
98
- finally {
99
- await fast.app.close();
100
- }
101
78
  console.log('\n=== Summary ===');
102
79
  for (const r of results) {
103
80
  console.log(`${r.name}: ${r.rps.toFixed(0)} req/sec, p99=${r.p99.toFixed(1)}ms, total=${r.total}`);
@@ -105,15 +82,10 @@ async function run() {
105
82
  // Calculate improvement
106
83
  const balanced_rps = results[0]?.rps || 0;
107
84
  const ultra_rps = results[1]?.rps || 0;
108
- const fastify_rps = results[2]?.rps || 0;
109
85
  if (ultra_rps > 0 && balanced_rps > 0) {
110
86
  const improvement = ((ultra_rps - balanced_rps) / balanced_rps * 100).toFixed(1);
111
87
  console.log(`\nUltra vs Balanced improvement: ${improvement}%`);
112
88
  }
113
- if (ultra_rps > 0 && fastify_rps > 0) {
114
- const ratio = (ultra_rps / fastify_rps).toFixed(2);
115
- console.log(`Ultra vs Fastify ratio: ${ratio}x`);
116
- }
117
89
  process.exit(0);
118
90
  }
119
91
  run().catch((err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qhttpx",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "**URL:** https://qhttpx.gridrr.com",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -16,7 +16,6 @@
16
16
  "example": "npx tsx examples/api-server.ts",
17
17
  "bench": "npm run build && node dist/src/benchmarks/simple-json.js",
18
18
  "bench:quantam": "npm run build && node dist/src/benchmarks/quantam-users.js",
19
- "bench:compare": "npm run build && node dist/src/benchmarks/compare-frameworks.js",
20
19
  "bench:ultra": "npm run build && node dist/src/benchmarks/ultra-mode.js"
21
20
  },
22
21
  "keywords": [],
@@ -27,7 +26,6 @@
27
26
  "@types/autocannon": "^7.12.7",
28
27
  "@types/better-sqlite3": "^7.6.13",
29
28
  "@types/busboy": "^1.5.4",
30
- "@types/express": "^5.0.6",
31
29
  "@types/ioredis": "^4.28.10",
32
30
  "@types/mongodb": "^4.0.6",
33
31
  "@types/node": "^25.0.9",
@@ -49,9 +47,7 @@
49
47
  "dependencies": {
50
48
  "better-sqlite3": "^12.6.2",
51
49
  "busboy": "^1.6.0",
52
- "express": "^5.2.1",
53
50
  "fast-json-stringify": "^5.15.1",
54
- "fastify": "^5.7.1",
55
51
  "pino": "^10.2.0",
56
52
  "pino-pretty": "^13.1.3",
57
53
  "quantam-async": "^0.1.1",
@@ -1,5 +1,4 @@
1
1
  import autocannon from 'autocannon';
2
- import fastify from 'fastify';
3
2
  import { QHTTPX } from '../index';
4
3
 
5
4
  type BenchResult = {
@@ -80,22 +79,6 @@ async function startQHTTPXUltra() {
80
79
  return { app, url };
81
80
  }
82
81
 
83
- async function startFastify() {
84
- const app = fastify();
85
-
86
- app.get('/json', async () => {
87
- return { message: 'hello from fastify' };
88
- });
89
-
90
- await app.listen({ port: 0, host: '127.0.0.1' });
91
- const address = app.server.address();
92
- if (!address || typeof address === 'string') {
93
- throw new Error('Fastify address not available');
94
- }
95
- const url = `http://127.0.0.1:${address.port}/json`;
96
- return { app, url };
97
- }
98
-
99
82
  async function run() {
100
83
  const results: BenchResult[] = [];
101
84
 
@@ -117,15 +100,6 @@ async function run() {
117
100
  await ultra.app.close();
118
101
  }
119
102
 
120
- console.log('\n=== Fastify Baseline ===');
121
- const fast = await startFastify();
122
- try {
123
- const r = await runAutocannon('Fastify', fast.url);
124
- results.push(r);
125
- } finally {
126
- await fast.app.close();
127
- }
128
-
129
103
  console.log('\n=== Summary ===');
130
104
  for (const r of results) {
131
105
  console.log(
@@ -138,17 +112,11 @@ async function run() {
138
112
  // Calculate improvement
139
113
  const balanced_rps = results[0]?.rps || 0;
140
114
  const ultra_rps = results[1]?.rps || 0;
141
- const fastify_rps = results[2]?.rps || 0;
142
115
 
143
116
  if (ultra_rps > 0 && balanced_rps > 0) {
144
117
  const improvement = ((ultra_rps - balanced_rps) / balanced_rps * 100).toFixed(1);
145
118
  console.log(`\nUltra vs Balanced improvement: ${improvement}%`);
146
119
  }
147
-
148
- if (ultra_rps > 0 && fastify_rps > 0) {
149
- const ratio = (ultra_rps / fastify_rps).toFixed(2);
150
- console.log(`Ultra vs Fastify ratio: ${ratio}x`);
151
- }
152
120
 
153
121
  process.exit(0);
154
122
  }
@@ -1,119 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const autocannon_1 = __importDefault(require("autocannon"));
7
- const fastify_1 = __importDefault(require("fastify"));
8
- const express_1 = __importDefault(require("express"));
9
- const index_1 = require("../index");
10
- async function runAutocannon(name, url) {
11
- const result = await (0, autocannon_1.default)({
12
- url,
13
- connections: 200,
14
- pipelining: 10,
15
- duration: 10,
16
- });
17
- const total = result.requests.total;
18
- const sent = result.requests.sent;
19
- const rps = result.requests.average;
20
- const p99 = result.latency.p99;
21
- console.log(`${name} bench: total=${total} (sent=${sent}) req, ` +
22
- `${rps.toFixed(0)} req/sec, p99=${p99.toFixed(1)}ms, connections=${result.connections}, pipelining=${result.pipelining}`);
23
- return {
24
- name,
25
- total,
26
- sent,
27
- rps,
28
- p99,
29
- };
30
- }
31
- async function startQHTTPX() {
32
- const payloadBuffer = Buffer.from(JSON.stringify({ message: 'hello from qhttpx' }));
33
- const app = new index_1.QHTTPX({
34
- maxConcurrency: 1024,
35
- metricsEnabled: false,
36
- jsonSerializer: () => payloadBuffer,
37
- });
38
- app.get('/json', (ctx) => {
39
- ctx.json({ message: 'hello from qhttpx' });
40
- });
41
- const { port } = await app.listen(0, '127.0.0.1');
42
- const url = `http://127.0.0.1:${port}/json`;
43
- return { app, url };
44
- }
45
- async function startFastify() {
46
- const app = (0, fastify_1.default)();
47
- app.get('/json', async () => {
48
- return { message: 'hello from fastify' };
49
- });
50
- await app.listen({ port: 0, host: '127.0.0.1' });
51
- const address = app.server.address();
52
- if (!address || typeof address === 'string') {
53
- throw new Error('Fastify address not available');
54
- }
55
- const url = `http://127.0.0.1:${address.port}/json`;
56
- return { app, url };
57
- }
58
- async function startExpress() {
59
- const app = (0, express_1.default)();
60
- app.get('/json', (_req, res) => {
61
- res.json({ message: 'hello from express' });
62
- });
63
- const server = await new Promise((resolve) => {
64
- const s = app.listen(0, '127.0.0.1', () => {
65
- resolve(s);
66
- });
67
- });
68
- const address = server.address();
69
- if (!address || typeof address === 'string') {
70
- throw new Error('Express address not available');
71
- }
72
- const url = `http://127.0.0.1:${address.port}/json`;
73
- return { app, url, server };
74
- }
75
- async function run() {
76
- const results = [];
77
- const qhttpx = await startQHTTPX();
78
- try {
79
- const r = await runAutocannon('QHTTPX', qhttpx.url);
80
- results.push(r);
81
- }
82
- finally {
83
- await qhttpx.app.close();
84
- }
85
- const fast = await startFastify();
86
- try {
87
- const r = await runAutocannon('Fastify', fast.url);
88
- results.push(r);
89
- }
90
- finally {
91
- await fast.app.close();
92
- }
93
- const exp = await startExpress();
94
- try {
95
- const r = await runAutocannon('Express', exp.url);
96
- results.push(r);
97
- }
98
- finally {
99
- await new Promise((resolve, reject) => {
100
- exp.server.close((err) => {
101
- if (err) {
102
- reject(err);
103
- }
104
- else {
105
- resolve();
106
- }
107
- });
108
- });
109
- }
110
- console.log('\nSummary:');
111
- for (const r of results) {
112
- console.log(`${r.name}: ${r.rps.toFixed(0)} req/sec, p99=${r.p99.toFixed(1)}ms, total=${r.total}`);
113
- }
114
- process.exit(0);
115
- }
116
- run().catch((err) => {
117
- console.error(err);
118
- process.exit(1);
119
- });
@@ -1,149 +0,0 @@
1
- import autocannon from 'autocannon';
2
- import fastify from 'fastify';
3
- import express, { Request, Response } from 'express';
4
- import { QHTTPX } from '../index';
5
-
6
- type BenchResult = {
7
- name: string;
8
- total: number;
9
- sent: number;
10
- rps: number;
11
- p99: number;
12
- };
13
-
14
- async function runAutocannon(name: string, url: string): Promise<BenchResult> {
15
- const result = await autocannon({
16
- url,
17
- connections: 200,
18
- pipelining: 10,
19
- duration: 10,
20
- });
21
-
22
- const total = result.requests.total;
23
- const sent = result.requests.sent;
24
- const rps = result.requests.average;
25
- const p99 = result.latency.p99;
26
-
27
- console.log(
28
- `${name} bench: total=${total} (sent=${sent}) req, ` +
29
- `${rps.toFixed(0)} req/sec, p99=${p99.toFixed(
30
- 1,
31
- )}ms, connections=${result.connections}, pipelining=${
32
- result.pipelining
33
- }`,
34
- );
35
-
36
- return {
37
- name,
38
- total,
39
- sent,
40
- rps,
41
- p99,
42
- };
43
- }
44
-
45
- async function startQHTTPX() {
46
- const payloadBuffer = Buffer.from(
47
- JSON.stringify({ message: 'hello from qhttpx' }),
48
- );
49
- const app = new QHTTPX({
50
- maxConcurrency: 1024,
51
- metricsEnabled: false,
52
- jsonSerializer: () => payloadBuffer,
53
- });
54
-
55
- app.get('/json', (ctx) => {
56
- ctx.json({ message: 'hello from qhttpx' });
57
- });
58
-
59
- const { port } = await app.listen(0, '127.0.0.1');
60
- const url = `http://127.0.0.1:${port}/json`;
61
- return { app, url };
62
- }
63
-
64
- async function startFastify() {
65
- const app = fastify();
66
-
67
- app.get('/json', async () => {
68
- return { message: 'hello from fastify' };
69
- });
70
-
71
- await app.listen({ port: 0, host: '127.0.0.1' });
72
- const address = app.server.address();
73
- if (!address || typeof address === 'string') {
74
- throw new Error('Fastify address not available');
75
- }
76
- const url = `http://127.0.0.1:${address.port}/json`;
77
- return { app, url };
78
- }
79
-
80
- async function startExpress() {
81
- const app = express();
82
- app.get('/json', (_req: Request, res: Response) => {
83
- res.json({ message: 'hello from express' });
84
- });
85
-
86
- const server = await new Promise<import('http').Server>((resolve) => {
87
- const s = app.listen(0, '127.0.0.1', () => {
88
- resolve(s);
89
- });
90
- });
91
- const address = server.address();
92
- if (!address || typeof address === 'string') {
93
- throw new Error('Express address not available');
94
- }
95
- const url = `http://127.0.0.1:${address.port}/json`;
96
- return { app, url, server };
97
- }
98
-
99
- async function run() {
100
- const results: BenchResult[] = [];
101
-
102
- const qhttpx = await startQHTTPX();
103
- try {
104
- const r = await runAutocannon('QHTTPX', qhttpx.url);
105
- results.push(r);
106
- } finally {
107
- await qhttpx.app.close();
108
- }
109
-
110
- const fast = await startFastify();
111
- try {
112
- const r = await runAutocannon('Fastify', fast.url);
113
- results.push(r);
114
- } finally {
115
- await fast.app.close();
116
- }
117
-
118
- const exp = await startExpress();
119
- try {
120
- const r = await runAutocannon('Express', exp.url);
121
- results.push(r);
122
- } finally {
123
- await new Promise<void>((resolve, reject) => {
124
- exp.server.close((err: unknown) => {
125
- if (err) {
126
- reject(err);
127
- } else {
128
- resolve();
129
- }
130
- });
131
- });
132
- }
133
-
134
- console.log('\nSummary:');
135
- for (const r of results) {
136
- console.log(
137
- `${r.name}: ${r.rps.toFixed(0)} req/sec, p99=${r.p99.toFixed(
138
- 1,
139
- )}ms, total=${r.total}`,
140
- );
141
- }
142
-
143
- process.exit(0);
144
- }
145
-
146
- run().catch((err) => {
147
- console.error(err);
148
- process.exit(1);
149
- });