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

cjs-vs-amd-benchmark

v0.1.4

Published

Compare load times of CJS and AMD module systems

Downloads

13

Readme

CJS/AMD load time benchmark

Compare load times of two module systems.

It's basic benchmark that compares speed of both systems when used in development mode.

Main point is to show that server-side generation of a bundle on request is not necessarily slower than loading modules asynchronously from the browser. It's actually opposite and difference can be significant. See the results section for numbers.

AMD modules are loaded with RequireJS and CommonJS modules are bundled on request with Webmake.

There's no prebuild step, in both cases modules are loaded/bundled on request. In case of AMD, they're loaded asynchronously in a browser. In case of CJS when request occurs they're read from filesystem, bundled and served in one file.

To see fair results (adequate to your development environment) benchmark needs to be installed and launched locally.

You can also check it working at medyk.org:3700, but mind it's backed with basic Node.js server setup (not very efficient for AMD), and due to extra latency, results will be worse than when running same on your localhost.

Installation

Install package:

$ npm install cjs-vs-amd-benchmark

Generate dummy modules (by default it resembles 400 modules tree from existing real world project)

$ npm run setup

You can generate custom number of out of provided modules map:
See bin/default-deps-map.json on how it should be constructed.

$ bin/generate --mapPath=path/to/custom/map

Start server (defaults to port 3000)

$ npm start

If you prefer other port, do:

$ bin/start --port=8080

Load the benchmark on corresponding port, e.g. localhost:3000

Results

Following load times were measured on 2008 MBP with local setups of Node.js and Nginx server, each number is average of 5 runs.

Node.js server setup was very basic, no clusters involved, so concurrency was limited (hence not great results for AMD).

Nginx was configured with Cache-Control: no-cache header, so browser always checks with the server whether new version of module is available.