Skip to content

Commit

Permalink
Add benchmark script for Bio::ClustalW::Report.
Browse files Browse the repository at this point in the history
  • Loading branch information
agrimm authored and ngoto committed Nov 23, 2013
1 parent 07c14e9 commit c5d3e76
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions sample/benchmark_clustalw_report.rb
@@ -0,0 +1,31 @@
#
# = sample/benchmark_clustalw_report.rb - Benchmark tests for Bio::ClustalW::Report
#
# Copyright:: Copyright (C) 2013
# Andrew Grimm <andrew.j.grimm@gmail.com>
# License:: The Ruby License

require 'pathname'
load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 1, "test",
'bioruby_test_helper.rb')).cleanpath.to_s

require 'benchmark'
require 'bio'

module BenchmarkClustalWReport
def self.benchmark_clustalw_report
Benchmark.bmbm do |x|
test_data_path = Pathname.new(File.join(BioRubyTestDataPath, 'clustalw')).cleanpath.to_s
aln_filename = File.join(test_data_path, 'example1.aln')
text = File.read(aln_filename)
x.report do
for i in 1...10_000
aln = Bio::ClustalW::Report.new(text)
aln.alignment
end
end
end
end
end

BenchmarkClustalWReport.benchmark_clustalw_report

0 comments on commit c5d3e76

Please sign in to comment.