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 🙏

© 2024 – Pkg Stats / Ryan Hefner

benchmarker

v0.2.6

Published

A tool to benchmark software

Downloads

36

Readme

Benchmarker

A benchmarking tool with it's own configuration file.

Usage

Usage: benchmarker [options]

Options:

  -h, --help                        output usage information
  -b, --benchfile [file]            path to a Benchfile
  -q, --quiet                       quiet mode only shows results
  -v, --verbose                     verbose mode says what is happening
  -d, --debug                       debug mode keeps run information in output
  -s, --sort                        sort mode sorts results by fastest total time
  -f, --format [json|csv|tsv|xml]   specify the output format
  -o, --output [file]               save results to output file
  -r, --runs [int]                  how many runs to perform

Try it out

git clone [email protected]:montanaflynn/benchmarker.git
cd benchmarker
npm install
./benchmarker -b example/Benchfile

Protip: Use jq to fine-tune the returned json data. Here's an example:

# Be sure to use --quiet or -q so benchmarker only outputs JSON
benchmarker --quiet | jq '[.[] | {name: .name, total: .results.total}]'

Readme Driven Development

Thar be dragons below; things may not work or be accurate.

Create a json Benchfile that has a benchmark property with an array of objects representing the software you want to benchmark. Each object must have a name and path property and may contain an optional command. You can also send options in an options object.

{
    "benchmark": [
        {
            "name": "Node MD5",
            "path": "./md5.js",
            "command": "node"
        },
        {
            "name": "Python MD5",
            "path": "./md5.py",
            "command": "python"
        },
        {
            "name": "GO MD5",
            "path": "./gomd5"
        }
    ], 
    "options": {
        "verbose": false,
        "debug": false,
        "runs": 5
    }
}

Results

For now output is JSON of this structure:

{
    "options": {
        "runs": 100,
        "debug": true,
        "unit": "ms"
    },
    "benchmarks": [
        {
            "name": "Rust",
            "success": 100,
            "error": 0,
            "runs": [
                {
                    "exit": 0,
                    "time": 32,
                    "stdout": "yay it worked",
                    "stdoutlines": 1,
                    "stdoutlength": 13,
                    "stderr": null,
                    "stderrlines": null,
                    "stderrlength": null
                }
            ],
            "results": {
                "min": 32,
                "max": 55,
                "total": 3391,
                "average": 33.91,
                "stdDev": 2.7,
                "percentile": {
                    "95th": 38,
                    "75th": 34,
                    "50th": 33,
                    "25th": 32,
                    "5th": 33
                }
            }
        }
    ]
}

Todos

  • I'd like to see charts, outliers, sorting, csv, plugins, etc...