npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

http-delta

v0.1.1

Published

Drop-in performance accelerator for Express and Fastify

Readme

⚡ http-delta

Drop-in performance accelerator for Express and Fastify.

http-delta helps existing Node.js servers run closer to their real performance potential — without rewrites, framework migrations, or risky changes. It applies smart HTTP tuning, reduces response overhead, and adds production-grade monitoring in a single line.


🚀 Why http-delta?

Most Node servers in the wild are under-tuned. Common issues include:

  • Suboptimal keep-alive settings
  • Unnecessary connection churn
  • Chunked encoding overhead
  • Underutilized CPU cores
  • Hidden event-loop blocking

http-delta fixes these automatically while keeping your current stack intact.

Goal: measurable performance and stability improvements with near-zero migration cost.


✨ Key Features

🔧 Smart Server Tuning

Applies safe, high-impact defaults to Node’s HTTP server:

  • Optimized keep-alive behavior
  • Improved timeout configuration
  • TCP socket tuning
  • Better connection reuse

⚡ Fast Response Helpers

Low-overhead response paths that reduce allocations and avoid chunked encoding.

res.fastText("OK")
res.fastJson({ success: true })
res.fastEmpty()

Benefits

  • Lower CPU per request
  • Reduced GC pressure
  • Better tail latency

🧠 Event Loop Monitoring

Detects when your server starts to struggle.

  • Event loop lag detection
  • Early overload signals
  • Production visibility

🧩 Easy Multi-Core Scaling

Optional helper to fully utilize available CPU cores.

import { enableCluster } from "@srikant/http-delta"
enableCluster()

🧪 Framework Compatible

Works with:

  • ✅ Express
  • ✅ Fastify
  • ✅ Native node:http

No middleware rewrites required.


📦 Installation

npm install @srikant/http-delta

Requirements

  • Node.js ≥ 18
  • Express or Fastify (optional)

🚀 Quick Start

Express Example

import express from "express"
import { accelerate } from "@srikant/http-delta"

const app = express()

app.get("/", (req, res) => {
  res.fastText("Hello from delta")
})

const server = app.listen(3000)

// Enable acceleration AFTER listen()
accelerate(server)

Fastify Example

import Fastify from "fastify"
import { accelerate } from "@srikant/http-delta"

const app = Fastify()

app.get("/", async (req, reply) => {
  reply.raw.fastJson({ ok: true })
})

await app.listen({ port: 3000 })
accelerate(app)

⚙️ API Reference

accelerate(appOrServer, options?)

Enables http-delta optimizations.

Parameters

  • appOrServer — Express server, Fastify instance, or http.Server
  • options — optional configuration

Important: call after .listen().


Options

{
  keepAliveTimeout?: number
  headersTimeout?: number
  requestTimeout?: number
  maxRequestsPerSocket?: number
  monitor?: boolean
  monitorOptions?: {
    threshold?: number
    interval?: number
  }
  log?: boolean
}

enableCluster(options?)

Forks workers equal to CPU cores.

enableCluster({ workers: 4 })

Note: call this at the very start of your app.


monitorEventLoop(options?)

Manual event loop monitoring.

monitorEventLoop({
  threshold: 50,
  interval: 5000
})

📊 Expected Performance Impact

Realistic improvements (typical API workloads):

| Scenario | Typical Gain | | --------------- | ------------ | | Vanilla Express | baseline |

  • http-delta tuning | +15–30% RPS |
  • fast responses | +10–30% |
  • proper clustering | 2×–6× throughput | Tail latency | noticeably improved |

Results vary based on workload, payload size, and infrastructure.


🧪 Benchmarking

We recommend testing with autocannon:

npx autocannon -c 200 -d 20 http://localhost:3000

Test:

  • before http-delta
  • after http-delta
  • with clustering

🧠 Design Philosophy

http-delta intentionally does not replace Node’s HTTP stack.

Instead it:

  • removes common inefficiencies
  • improves defaults
  • reduces per-request overhead
  • adds production safety rails

This makes it safe to adopt in existing systems.


⚠️ What http-delta is NOT

To set clear expectations:

  • ❌ Not a framework replacement
  • ❌ Not a Go-style runtime
  • ❌ Not faster than native C++ servers in all cases
  • ❌ Not a silver bullet for slow databases

It is a practical performance multiplier for real Node apps.


🗺️ Roadmap

Planned future work:

  • [ ] Advanced backpressure controls
  • [ ] Adaptive keep-alive tuning
  • [ ] Native turbo engine (Rust)
  • [ ] uWebSockets adapter mode
  • [ ] Built-in metrics export

🤝 Contributing

Contributions and performance reports are welcome.

If you benchmark http-delta in production-like workloads, please open an issue.


📜 License

MIT © Srikant Pandey


⭐ If this project helps you

Please consider starring the repo and sharing benchmarks — real-world data helps the project mature.