Skip to content

Commit

Permalink
Update comments in benchmark.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
alindeman committed Dec 27, 2010
1 parent 1003ce4 commit 02f6c45
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions benchmark.rb
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
# Benchmarking code from
# http://www.rubyquiz.com/quiz137.html

# Compare:
# ruby benchmark.rb
# ruby -r lib/rope.rb -I lib benchmark.rb Rope::Rope

require 'benchmark'

#This code make a String/Rope of CHUNCKS chunks of text
#each chunck is SIZE bytes long. Each chunck starts with
#an 8 byte number. Initially the chuncks are shuffled the
#qsort method sorts them into ascending order.
#
#pass the name of the class to use as a parameter
#ruby -r rope.rb this_file Rope

puts 'preparing data...'
TextClass = eval(ARGV.shift || :String)
TextClass = eval(ARGV.shift || "String")

def qsort(text)
return TextClass.new if text.length == 0
Expand Down

0 comments on commit 02f6c45

Please sign in to comment.