<commit_before>Benchmark = require 'benchmark'
Queue1 = require '../Queue'
Queue2 = require '../Queue2'

queue1 = new Queue1()
queue2 = new Queue2()

suite = new Benchmark.Suite
suite.add 'Queue1 enqueue', () -> queue1.enqueue Math.random()

suite.add 'Queue2 enqueue', () -> queue2.enqueue Math.random()

suite.on 'cycle', (event) -> console.log String(event.target)

suite.on 'complete', () ->
  console.log('Fastest is ' + this.filter('fastest').pluck('name'))

# suite.run()

suite2 = new Benchmark.Suite
suite2.add 'Queue1 dequeue', () -> queue1.dequeue()

suite2.add 'Queue2 dequeue', () -> queue2.dequeue()

suite2.on 'cycle', (event) -> console.log String(event.target)

suite2.on 'complete', () ->
  console.log('Fastest is ' + this.filter('fastest').pluck('name'))

# suite2.run()

suite3 = new Benchmark.Suite
suite3.add 'Queue1 dequeue', () ->
    queue1.enqueue Math.random()
    queue1.dequeue()

suite3.add 'Queue2 dequeue', () ->
    queue2.enqueue Math.random()
    queue2.dequeue()

suite3.on 'cycle', (event) -> console.log String(event.target)

suite3.on 'complete', () ->
  console.log('Fastest is ' + this.filter('fastest').pluck('name'))

suite3.run()<commit_msg>Notice of innacuracy in benchmark.<commit_after># NOTE: innacurate benchmark. Number of operations should be a constant.

Benchmark = require 'benchmark'
Queue1 = require '../Queue'
Queue2 = require '../Queue2'
Queue3 = require '../LinkedList2'

queue1 = new Queue1()
queue2 = new Queue2()
queue3 = new Queue3()

suite = new Benchmark.Suite
suite.add 'Queue1 enqueue', () -> queue1.enqueue Math.random()
suite.add 'Queue2 enqueue', () -> queue2.enqueue Math.random()
suite.add 'Queue3 enqueue', () -> queue3.add Math.random()

suite.on 'cycle', (event) -> console.log String(event.target)

suite.on 'complete', () ->
  console.log('Fastest is ' + this.filter('fastest').pluck('name'))

suite.run()

suite2 = new Benchmark.Suite
suite2.add 'Queue1 dequeue', () -> queue1.dequeue()
suite2.add 'Queue2 dequeue', () -> queue2.dequeue()
suite2.add 'Queue3 dequeue', () -> queue3.remove 0

suite2.on 'cycle', (event) -> console.log String(event.target)

suite2.on 'complete', () ->
  console.log('Fastest is ' + this.filter('fastest').pluck('name'))

suite2.run()

suite3 = new Benchmark.Suite
suite3.add 'Queue1 enqueue+dequeue', () ->
    queue1.enqueue Math.random()
    queue1.dequeue()

suite3.add 'Queue2 enqueue+dequeue', () ->
    queue2.enqueue Math.random()
    queue2.dequeue()

suite3.add 'Queue3 enqueue+dequeue', () ->
    queue3.add Math.random()
    queue3.remove 0

suite3.on 'cycle', (event) -> console.log String(event.target)

suite3.on 'complete', () ->
  console.log('Fastest is ' + this.filter('fastest').pluck('name'))

suite3.run()
{'fraction_non_alphanumeric': 0.1823830409356725, 'fraction_numerical': 0.029605263157894735, 'mean_word_length': 4.273603082851638, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 30, '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': '4589774', 'n_tokens_mistral': 965, 'n_tokens_neox': 951, 'n_words': 211}