Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eruda-benchmark

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eruda-benchmark

Eruda plugin for running JavaScript benchmarks

  • 1.0.0
  • npm
  • Socket score

Version published
Weekly downloads
113
increased by25.56%
Maintainers
1
Weekly downloads
 
Created
Source

eruda-benchmark

NPM version Build status License

Eruda plugin for running JavaScript benchmarks.

Demo

Browse it on your phone: http://eruda.liriliri.io/?plugin=benchmark

Install

npm install eruda-benchmark --save
eruda.add(erudaBenchmark);

Make sure Eruda is loaded before this plugin, otherwise won't work.

Usage

After initialization:

var benchmark = eruda.get('benchmark');

benchmark.add('Test', function () 
{
    var arr = new Array(10000); 
    for (var i = 0; i < 10000; i++) arr[i] = i * 2;
});
benchmark.add('Test Suite', [
    {
        name: 'RegExp#test',
        fn: function () 
        {
            /o/.test('Hello World!');
        }
    },
    {
        name: 'String#indexOf',
        fn: function () 
        {
            'Hello World!'.indexOf('o') > -1;
        }
    },
    {
        name: 'String#match',
        fn: function ()
        {
            !!'Hello World!'.match(/o/);
        }
    }
]);

Keywords

FAQs

Package last updated on 06 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc