<commit_before>$: << File.expand_path('../../lib', __FILE__)
require 'benchmark'
require 'exif'
require 'exifr'

N = 500
FILE_PATH = File.expand_path('../../spec/sample.jpg', __FILE__)
exifr = EXIFR::JPEG.new(FILE_PATH)
exif  = Exif::Data.new(FILE_PATH)
Benchmark.bmbm do |x|
  x.report '[exifr] init' do
    N.times{ EXIFR::JPEG.new(FILE_PATH).width }
  end
  x.report '[exif]  init' do
    N.times{ Exif::Data.new(FILE_PATH).image_width }
  end
  x.report '[exifr] get width' do
    N.times{ exifr.width }
  end
  x.report '[exif]  get width' do
    N.times{ exif.image_width }
  end
end<commit_msg>update benchmark<commit_after>$: << File.expand_path('../../lib', __FILE__)
require 'benchmark'
require 'exif'
require 'exifr'

N = 500
FILE_PATH = File.expand_path('../../spec/sample.jpg', __FILE__)
Benchmark.bmbm do |x|
  x.report '[exifr] init' do
    N.times{ EXIFR::JPEG.new(FILE_PATH).width }
  end
  x.report '[exif]  init' do
    N.times{ Exif::Data.new(FILE_PATH).image_width }
  end
end
{'fraction_non_alphanumeric': 0.17452357071213642, 'fraction_numerical': 0.006018054162487462, 'mean_word_length': 3.7523809523809524, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5410862', 'n_tokens_mistral': 405, 'n_tokens_neox': 404, 'n_words': 84}