<commit_before>var messageName = 'event-loop-test'

var debug
var count_loop = 0
var count_frame = 0
var prev = performance.now()

var handleMessage = (event) => {
    window.postMessage(messageName, '*')
    count_loop++
}

var displayLoop = () => {
  requestAnimationFrame(displayLoop)

  var stamp = performance.now()
  var fps = 1000/(stamp - prev)
  prev = stamp

  debug.innerHTML = 'FPS '+fps.toFixed(3)+' - # events between refresh - ' + count_loop
  count_loop = 0
}

window.addEventListener('DOMContentLoaded', () => {
  debug = document.getElementById('debug')

  window.addEventListener('message', handleMessage, true)
  window.postMessage(messageName, '*')

  requestAnimationFrame(displayLoop)
})
<commit_msg>scope speed testing<commit_after>var messageName = 'event-loop-test'

var debug
var count_loop = 0
var prev = performance.now()

//var stamp
//var fps

var handleMessage = (event) => {
  window.postMessage(messageName, '*')
  count_loop++
}

var displayLoop = () => {
  requestAnimationFrame(displayLoop)

  var stamp = performance.now()
  var fps = 1000 / (stamp - prev)
  prev = stamp

  debug.innerHTML = 'FPS ' + fps.toFixed(3) + ' - # events between refresh - ' + count_loop
  count_loop = 0
}

window.addEventListener('DOMContentLoaded', () => {
  debug = document.getElementById('debug')

  window.addEventListener('message', handleMessage, true)
  window.postMessage(messageName, '*')

  requestAnimationFrame(displayLoop)
})

{'fraction_non_alphanumeric': 0.13795470144131777, 'fraction_numerical': 0.01029512697323267, 'mean_word_length': 4.4, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4296847', 'n_tokens_mistral': 475, 'n_tokens_neox': 448, 'n_words': 100}