Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const lodash = require('lodash').memoize;
const ramda = require('ramda').memoize;
const memoizee = require('memoizee');
const fastMemoize = require('fast-memoize');
const addyOsmani = require('./addy-osmani');
const memoizerific = require('memoizerific');
const lruMemoize = require('lru-memoize').default;
const moize = require('moize').default;
const microMemoize = require('micro-memoize');
const iMemoized = require('iMemoized');
const nanomemoize = require('../src/nano-memoize.js');
const deepEquals = require('lodash').isEqual;
const fastDeepEqual = require('fast-equals').deepEqual;
const hashItEquals = require('hash-it').isEqual;
const showResults = (benchmarkResults) => {
const table = new Table({
head: ['Name', 'Ops / sec', 'Relative margin of error', 'Sample size']
});
benchmarkResults.forEach((result) => {
const name = result.target.name;
const opsPerSecond = result.target.hz.toLocaleString('en-US', {
maximumFractionDigits: 0
});
const relativeMarginOferror = `± ${result.target.stats.rme.toFixed(2)}%`;
const sampleSize = result.target.stats.sample.length;
table.push([name, opsPerSecond, relativeMarginOferror, sampleSize]);
});