Sha256: d89dfe6f471172902f0c51b06d7b5ae5e09141f427e25f682fce396d02d51491

Contents?: true

Size: 1.04 KB

Versions: 117

Compression:

Stored size: 1.04 KB

Contents

require_relative 'benchmark_helper'
require 'flydata/parser/mysql/dump_parser'
require 'zlib'

INSERT_TEST_FILE_NAME = case ARGV[0]
                        when 'num'
                          'insert_parser_test_data_num_only.sql.gz'
                        else
                          'insert_parser_test_data.sql.gz'
                        end
INSERT_TEST_FILE_PATH = File.realpath("data/#{INSERT_TEST_FILE_NAME}", File.dirname(__FILE__))
def readline_gz_file(gz_file_path = INSERT_TEST_FILE_PATH)
  Zlib::GzipReader.open(gz_file_path) {|f| return f.readline}
end

@test_line = readline_gz_file

def subject
  Flydata::Parser::Mysql::MysqlDumpParser::InsertParser.new.parse(@test_line)
  Flydata::Parser::Mysql::MysqlDumpParser::InsertParser.new.parse(@test_line)
  Flydata::Parser::Mysql::MysqlDumpParser::InsertParser.new.parse(@test_line)
  Flydata::Parser::Mysql::MysqlDumpParser::InsertParser.new.parse(@test_line)
  Flydata::Parser::Mysql::MysqlDumpParser::InsertParser.new.parse(@test_line)
end

Benchmark.bm do |x|
  x.report { 10.times{ subject } }
end

Version data entries

117 entries across 117 versions & 1 rubygems

Version Path
flydata-0.3.17 benchmark/insert_parser_bench.rb
flydata-0.3.16 benchmark/insert_parser_bench.rb
flydata-0.3.15 benchmark/insert_parser_bench.rb
flydata-0.3.14 benchmark/insert_parser_bench.rb
flydata-0.3.13 benchmark/insert_parser_bench.rb
flydata-0.3.12 benchmark/insert_parser_bench.rb
flydata-0.3.11 benchmark/insert_parser_bench.rb
flydata-0.3.10 benchmark/insert_parser_bench.rb
flydata-0.3.9 benchmark/insert_parser_bench.rb
flydata-0.3.8 benchmark/insert_parser_bench.rb
flydata-0.3.7 benchmark/insert_parser_bench.rb
flydata-0.3.6 benchmark/insert_parser_bench.rb
flydata-0.3.5 benchmark/insert_parser_bench.rb
flydata-0.3.4 benchmark/insert_parser_bench.rb
flydata-0.3.3 benchmark/insert_parser_bench.rb
flydata-0.3.2 benchmark/insert_parser_bench.rb
flydata-0.3.1 benchmark/insert_parser_bench.rb
flydata-0.3.0 benchmark/insert_parser_bench.rb
flydata-0.2.30 benchmark/insert_parser_bench.rb
flydata-0.2.29 benchmark/insert_parser_bench.rb