<commit_before>require 'benchmark'
 
total = (ENV['TOTAL'] || 1_000).to_i

Tuple = Array unless defined?(Tuple)

tuple = Tuple.new(total)
total.times do |i|
  tuple.put(i,i)
end
<commit_msg>Fake at/put/swap for mri on tuple so that bm_tuple works on mri<commit_after>require 'benchmark'
 
total = (ENV['TOTAL'] || 1_000).to_i

unless defined?(Tuple)
  Tuple = Array
  class Tuple
    def swap(i,j)
      temp = at(i)
      put(i, at(j))
      put(j, temp)
    end

    alias :at :[]
    alias :put :[]=
  end
end

tuple = Tuple.new(total)
total.times do |i|
  tuple.put(i,i)
end

{'fraction_non_alphanumeric': 0.14680483592400692, 'fraction_numerical': 0.013816925734024179, 'mean_word_length': 3.2962962962962963, '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': '5191499', 'n_tokens_mistral': 245, 'n_tokens_neox': 233, 'n_words': 60}