~ubuntu-branches/ubuntu/lucid/jruby/lucid

« back to all changes in this revision

Viewing changes to bench/language/bench_bignum.rb

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Delafond
  • Date: 2009-12-09 17:30:55 UTC
  • Revision ID: james.westby@ubuntu.com-20091209173055-8ffzikq1768gywux
Tags: upstream-1.3.1
ImportĀ upstreamĀ versionĀ 1.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
require 'benchmark'
 
2
 
 
3
def bench_bignum(bm)
 
4
  bm.report("control: 1m block with self") { 1_000_000.times { self }}
 
5
  bm.report("1m bignums") { 1_000_000.times { 111_111_111_111_111_111_111_111_111_111 }}
 
6
end
 
7
 
 
8
if $0 == __FILE__
 
9
  (ARGV[0] || 10).to_i.times { Benchmark.bm(30) {|bm| bench_bignum(bm)} }
 
10
end
 
 
b'\\ No newline at end of file'