<commit_before>require 'rubygems'
require 'ruby-prof'
$:.push File.join(File.dirname(__FILE__), 'lib')

require 'redis'
@r = Redis.new
@r['foo'] = "The first line we sent to the server is some text"

mode = ARGV.shift || 'process_time'
RubyProf.measure_mode = RubyProf.const_get(mode.upcase)
RubyProf.start
100.times do |i|
  @r["foo#{i}"] = "The first line we sent to the server is some text"
  10.times do
    @r["foo#{i}"]
  end
end
results = RubyProf.stop
File.open("profile.#{mode}", 'w') do |out|
  RubyProf::CallTreePrinter.new(results).print(out)
end<commit_msg>Require local redis lib first<commit_after>require 'rubygems'
require 'ruby-prof'
require "#{File.dirname(__FILE__)}/lib/redis"

@r = Redis.new
@r['foo'] = "The first line we sent to the server is some text"

mode = ARGV.shift || 'process_time'
RubyProf.measure_mode = RubyProf.const_get(mode.upcase)
RubyProf.start
100.times do |i|
  @r["foo#{i}"] = "The first line we sent to the server is some text"
  10.times do
    @r["foo#{i}"]
  end
end
results = RubyProf.stop
File.open("profile.#{mode}", 'w') do |out|
  RubyProf::CallTreePrinter.new(results).print(out)
end
{'fraction_non_alphanumeric': 0.1600703605980651, 'fraction_numerical': 0.008795074758135445, 'mean_word_length': 4.989473684210527, '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': '4455412', 'n_tokens_mistral': 447, 'n_tokens_neox': 424, 'n_words': 114}