<commit_before>class Bruevich
  class Bench
    ITERATIONS = [1, 10, 50, 100, 150]

    attr_reader :result
    attr_accessor :after_callback

    def initialize(iterations: nil)
      @iterations = iterations
      @result = {}
      @after_callback = -> {}
    end

    def bench(title = 'empty')
      result[:title] = title

      iterations.each do |count|
        initialize_result(count)

        GC.disable
        GC.start

        count.times do
          mem = memory.current_value
          yield
          result[count][:mem][:full] << memory.current_value - mem
        end

        GC.enable
        GC.start


        count.times do
          time = Time.now
          yield
          result[count][:time][:full] << Time.now - time
<commit_msg>Fix uncalled callback for memory benchmark<commit_after>class Bruevich
  class Bench
    ITERATIONS = [1, 10, 50, 100, 150]

    attr_reader :result
    attr_accessor :after_callback

    def initialize(iterations: nil)
      @iterations = iterations
      @result = {}
      @after_callback = -> {}
    end

    def bench(title = 'empty')
      result[:title] = title

      iterations.each do |count|
        initialize_result(count)

        GC.disable
        GC.start

        count.times do
          mem = memory.current_value
          yield
          result[count][:mem][:full] << memory.current_value - mem

          call_after_callback
        end

        GC.enable
        GC.start


        count.times do
          time = Time.now
          yield
          result[count][:time][:full] << Time.now - time

{'fraction_non_alphanumeric': 0.0949367088607595, 'fraction_numerical': 0.013924050632911392, 'mean_word_length': 1.8333333333333333, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, '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': '76212', 'n_tokens_mistral': 496, 'n_tokens_neox': 447, 'n_words': 110}