Skip to content

Many benchmark results in the readme are incorrect #608

@mohit61

Description

@mohit61

Hi,

I did the benchmarking using benchmark.js(which is a reliable benchmarking library) and the results were not same as mentioned in the readme, for eg. RamBda's compose according to benchmark result in the readme is 93.76% faster, but when I did a benchmark using benchmark.js the results of Ramda and RamBda were not much different

here is the snippet of the test suite:

const Benchmark = require("benchmark");
const Ra = require("ramda");
const Rb = require("rambda");


const classyGreeting = (firstName, lastName) =>
  "The name's " + lastName + ", " + firstName + " " + lastName;

const raYellGreeting = Ra.compose(Ra.toUpper, Ra.toLower, Ra.toUpper, classyGreeting);
const rbYellGreeting = Rb.compose(Ra.toUpper, Ra.toLower, Ra.toUpper, classyGreeting);

var suite = new Benchmark.Suite();

suite
  .add("Ramda compose", function () {
    raYellGreeting("James", "Bond");
  })
  .add("RamBda compose", function () {
    rbYellGreeting("James", "Bond");
  })
  .on("cycle", function (event) {
    console.log(String(event.target));
  })
  .on("complete", function () {
    console.log("Fastest is ", this.filter("fastest").map("name"));
  })
  // run async
  .run({ async: true });

output:

Ramda compose x 702,214 ops/sec ±2.08% (85 runs sampled)
RamBda compose x 739,388 ops/sec ±1.33% (88 runs sampled)
Fastest is  [ 'RamBda compose' ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions