<commit_before>Mathematical = require('../lib/mathematical')
Helpers = require './helpers'
fs = require 'fs'

describe "Performance", ->

  it "handles big files", ->
    big_file = fs.readFileSync("#{Helpers.fixturesDir()}/performance/big_file.text", "utf8")

    start = new Date().getTime();
    actual = big_file.replace(/\$\$([\s\S]+?)\$\$/g, Helpers.convertContent)
    actual = actual.replace(/\$([\s\S]+?)\$/g, Helpers.convertContent)
    end = new Date().getTime();

    sec = (end - start) / 1000
    expect(sec).toBeLessThan(5)
<commit_msg>Lint shmint<commit_after>Mathematical = require('../lib/mathematical')
Helpers = require './helpers'
fs = require 'fs'

describe "Performance", ->

  it "handles big files", ->
    big_file = fs.readFileSync("#{Helpers.fixturesDir()}/performance/big_file.text", "utf8")

    start = new Date().getTime()
    actual = big_file.replace(/\$\$([\s\S]+?)\$\$/g, Helpers.convertContent)
    actual = actual.replace(/\$([\s\S]+?)\$/g, Helpers.convertContent)
    end = new Date().getTime()

    sec = (end - start) / 1000
    expect(sec).toBeLessThan(5)

{'fraction_non_alphanumeric': 0.20947176684881602, 'fraction_numerical': 0.01092896174863388, 'mean_word_length': 3.656779661016949, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '6860208', 'n_tokens_mistral': 401, 'n_tokens_neox': 380, 'n_words': 69}