Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
+ performance tests for range queries
  • Loading branch information
floere committed Nov 6, 2012
1 parent 7cb4097 commit 66d57c4
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion server/prototypes/range_query/performance.rb
Expand Up @@ -26,9 +26,23 @@
p [:exc, :include?, (Time.now - t)]


ary = []
add = []

t = Time.now
1000.times do
ary + add unless add.empty?
end
p ['+ [] unless empty?', (Time.now - t)]
t = Time.now
1000.times do
ary + add
end
p ['+ []', (Time.now - t)]


# Splitting the text should only split on the first.
#

raise if "a-b-c".split('-', 2) != ['a', 'b-c']

s = "a-b-c"
Expand Down

0 comments on commit 66d57c4

Please sign in to comment.