<commit_before>/* glogals: suite, bench */
'use strict';

var main = require('..');
var indexOf = require('./index-of.js');
var regex = require('./regex.js');

var fixture = new Buffer(100);

suite('Detect file type', function () {
  set('iterations', 30000);

  bench('logical OR', function() {
    main(fixture);
  });

  bench('array.indexOf', function() {
    indexOf(fixture);
  });

  bench('regular expression', function() {
    regex(fixture);
  });
});<commit_msg>improve message test of benchmark script<commit_after>/* glogals: suite, bench */
'use strict';

var main = require('..');
var indexOf = require('./index-of.js');
var regex = require('./regex.js');

var fixture = new Buffer(100);

suite('Detect file type', function () {
  set('iterations', 30000);

  bench('logical OR (current version)', function() {
    main(fixture);
  });

  bench('array.indexOf', function() {
    indexOf(fixture);
  });

  bench('regular expression', function() {
    regex(fixture);
  });
});
{'fraction_non_alphanumeric': 0.20181634712411706, 'fraction_numerical': 0.016145307769929364, 'mean_word_length': 4.11340206185567, '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': '4183433', 'n_tokens_mistral': 332, 'n_tokens_neox': 306, 'n_words': 79}