<commit_before>require_relative '../../benchmark_helper'

doc = Oga.parse_xml(big_xml_file)

measure_average do
  doc.xpath('descendant-or-self::location')
end<commit_msg>Warm up caches in the XPath big XML benchmark<commit_after>require_relative '../../benchmark_helper'

doc = Oga.parse_xml(big_xml_file)

# Warm up any caches
doc.xpath('descendant-or-self::location')

measure_average do
  doc.xpath('descendant-or-self::location')
end
{'fraction_non_alphanumeric': 0.1324200913242009, 'fraction_numerical': 0.0, 'mean_word_length': 5.968253968253968, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '1454944', 'n_tokens_mistral': 155, 'n_tokens_neox': 152, 'n_words': 28}