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

@twada/benchmark-commits

v0.3.1

Published

Run benchmark on specified git commits

Downloads

18

Readme

benchmark-commits

Run benchmark on specified git commits.

Build Status NPM version Code Style License

INSTALL

$ npm install @twada/benchmark-commits

SPEC

runBenchmark(commitsOrSpecs, register): run benchmark for given commitsOrSpecs. Each benchmark function is registered via register function

  • if all benchmark executions have finished (at least one benchmark was successful), output benchmark result then resolve with benchmark suite

  • if all benchmark executions have failed, reject with Error

  • commitsOrSpecs is an array of either (1) string specifying git tag/branch/commit or (2) object having name and git properties, pointing to git object to be checked out for the benchmark

    • internally, each item in commitsOrSpecs is normalized to spec object in {name, git} form
      • if commitsOrSpecs is an array of string specifying git tag/branch/commit
        • converts each string to {name, git} form. name === git in this case.
        • use git object name as benchmark name
      • if commitsOrSpecs is already an array of spec object having {name, git} form
        • use them as spec object
        • generated benchmark name is name(git)
  • register is a benchmark registration function that returns benchmark function. benchmark registration function takes { suite, spec, dir} as arguments.

    • if register function runs synchronously, register benchmark function immediately
    • if register function is an async function or returns Promise, register benchmark function asynchronously
    • benchmark function (a function returned from register function) with no parameters will be executed synchronously
    • if benchmark function takes one parameter, it means that the benchmark function is intended to run asynchronously, so register it as deferred function
    • if benchmark function takes more than one parameter, skip benchmark registration for that spec since benchmark function is invalid
    • if git commit object in commitsOrSpecs does not exist in underlying git repository, skip benchmark registration for that spec
    • if error occurred while executing registration function, skip benchmark registration for that spec
    • if async registration function rejects, skip benchmark registration for that spec
    • if benchmark registration function does not return function, skip benchmark registration for that spec
    • if all benchmark registrations have skipped, rejects with Error

AUTHOR

LICENSE

Licensed under the MIT license.