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