Skip to main content
Module

x/rambda/source/benchmarks/pipe.js

Faster and smaller alternative to Ramda
Go to Latest
File
const R = require('../../dist/rambda.js')const Ramda = require('ramda')const _ = require('lodash')const {uniqListOfStrings} = require('./_utils.js')
const modes = [ [val => val.length, val => val + 1], [ x => x.join('---'), x => x.length, x => x + 1, x => `${x}-foo`, x => x.toLowerCase(), x => x.toUpperCase(), ], { special: true, fns: [ (firstName, lastName) => "The name's " + lastName + ', ' + firstName + ' ' + lastName, x => x.toUpperCase(), x => x.toLowerCase(), ], },]
const applyBenchmark = (fn, input) => { if (input.special) { return fn(...input.fns)(`foo`, `bar`) } return fn(...input)(uniqListOfStrings(100))}
const tests = [ { label: 'Rambda', fn: Ramda.pipe, }, { label: 'Ramda', fn: Ramda.pipe, }, // { // label: 'Lodash', // fn: _.flow, // },]
module.exports = {tests, applyBenchmark, modes}