<commit_before><commit_msg>rewrite bench with ruby-prof<commit_after>require "xpool"
require "ruby-prof"
class Unit
  def run(x)
    sleep x
  end
end

pool = nil
result = RubyProf.profile do
  pool = XPool.new 5
  5.times { pool.schedule Unit.new, 0.1 }
  pool.dry?
end

pool.shutdown
printer = RubyProf::FlatPrinter.new(result)
printer.print(STDOUT)
{'fraction_non_alphanumeric': 0.10826210826210826, 'fraction_numerical': 0.011396011396011397, 'mean_word_length': 4.253731343283582, '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': '4771958', 'n_tokens_mistral': 139, 'n_tokens_neox': 130, 'n_words': 33}