<commit_before>/* vim: set et sw=2 ts=2: */

"use strict";

var benchmark = require('./benchmark.js');
var underscore = require('underscore');
var nodash = require('../nodash.js');
var lodash = require('lodash');

function plus1(x) { return x + 1; }

benchmark.timeSuite({
  iterations: 10000,
  delay: 0,
  median: true
}, {

  something: idf(3),

  group: {
    something: idf(5),
    anything: function () { throw "Exception while executing"; }
  },

  map: {

    0: function () { return [ 1, 1, 2, 3, 5, 8, 13 ]; },

    underscore: function (xs) {
      underscore.map(xs, plus1);
    },

    lodash: function (xs) {
      lodash.map(xs, plus1);
    },

    nodash: function (xs) {
      nodash.map(plus1, xs);
    },

    nodashCurried: nodash.map(plus1)
  }

}, function (results) {
  benchmark.printResults(results);
});
<commit_msg>Removed example cases for testing benchmark utilities<commit_after>/* vim: set et sw=2 ts=2: */

"use strict";

var benchmark = require('./benchmark.js');
var underscore = require('underscore');
var nodash = require('../nodash.js');
var lodash = require('lodash');

function plus1(x) { return x + 1; }

benchmark.timeSuite({
  iterations: 10000,
  delay: 0,
  median: true
}, {

  map: {

    0: function () { return [ 1, 1, 2, 3, 5, 8, 13 ]; },

    underscore: function (xs) {
      underscore.map(xs, plus1);
    },

    lodash: function (xs) {
      lodash.map(xs, plus1);
    },

    nodash: function (xs) {
      nodash.map(plus1, xs);
    },

    nodashCurried: nodash.map(plus1)
  }

}, function (results) {
  benchmark.printResults(results);
});

{'fraction_non_alphanumeric': 0.17407639323731997, 'fraction_numerical': 0.03005635566687539, 'mean_word_length': 3.0661577608142494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '186936', 'n_tokens_mistral': 623, 'n_tokens_neox': 567, 'n_words': 143}