def run(instruction)
      @inst = instruction
      measurements = []

      # run pre_build hooks
      if @inst.respond_to? :pre_hooks
        measurements << Benchmark.measure('pre build:') do
          @inst.pre_hooks.each(&:call)
        end
      end

      # process the rows
      measurements << Benchmark.measure('process rows:') do
        @inst.options[:parallel] ? pprocess_rows : process_rows
      end

      # build
      measurements << Benchmark.measure('build:') do
        build @inst.consumers
      end

      # run post_build hooks
      if @inst.respond_to? :post_hooks
        measurements << Benchmark.measure('post build:') do
          @inst.post_hooks.each(&:call)
        end
      end
      report measurements if @inst.options[:benchmark]
    end
def run(instruction)
      @inst = instruction
      measurements = []

      # run pre_build hooks
      if @inst.respond_to? :pre_hooks
        measurements << Benchmark.measure('pre build:') do
          @inst.pre_hooks.each(&:call)
        end
      end

      # process the rows
      measurements << Benchmark.measure('process rows:') do
        @inst.options[:parallel] ? pprocess_rows : process_rows
      end

      # build
      measurements << Benchmark.measure('build:') do
        build @inst.consumers
      end

      # run post_build hooks
      if @inst.respond_to? :post_hooks
        measurements << Benchmark.measure('post build:') do
          @inst.post_hooks.each(&:call)
        end
      end
      report measurements if @inst.options[:benchmark]
    end
run the instruction