Skip to content

Commit

Permalink
Add limit to matcher benchmark.
Browse files Browse the repository at this point in the history
Without a limit the time is dominated by sorting all the results in a
single thread. The limit is configurable so it can be raised for testing
merging.
  • Loading branch information
kevincox committed Jun 24, 2017
1 parent f91f894 commit d44b560
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions bin/benchmarks/matcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,7 @@
# Copyright 2013-present Greg Hurrell. All rights reserved.
# Licensed under the terms of the BSD 2-clause license.

<<<<<<< HEAD
%w[ext lib].each do |dir|
path = File.expand_path("../../ruby/command-t/#{dir}", File.dirname(__FILE__))
$LOAD_PATH.unshift(path) unless $LOAD_PATH.include?(path)
end
=======
require_relative 'base.rb'
>>>>>>> 5ec4b0b... Add C scanner infrastructure.

require 'ostruct'
require 'yaml'
Expand All @@ -36,7 +29,8 @@ def exec b
matcher.sorted_matches_for(
query,
:threads => @threads,
:recurse => ENV.fetch('RECURSE', '1') == '1'
:recurse => ENV.fetch('RECURSE', '1') == '1',
:limit => ENV.fetch('LIMIT', '200').to_i,
)
query
end
Expand Down

0 comments on commit d44b560

Please sign in to comment.