diff --git a/tools/benchmark/collector.rb b/tools/benchmark/collector.rb deleted file mode 100644 index b8bbdeb10..000000000 --- a/tools/benchmark/collector.rb +++ /dev/null @@ -1,3 +0,0 @@ -# encoding: utf-8 -require "benchmark/ips" -require "logstash/instrument/collector" diff --git a/tools/benchmark/event_accessor.rb b/tools/benchmark/event_accessor.rb deleted file mode 100644 index 018785b51..000000000 --- a/tools/benchmark/event_accessor.rb +++ /dev/null @@ -1,17 +0,0 @@ -# encoding: utf-8 -require "benchmark/ips" -require "logstash/event" - -options = { :time => 10, :warmup => 60 } -puts "Same Event instance" - -event = LogStash::Event.new("foo" => {"bar" => {"foobar" => "morebar"} }) -STDERR.puts "" -STDERR.puts " ----------> event.get(\"[foo][bar][foobar]\") => #{event.get("[foo][bar][foobar]")}" -STDERR.puts "" - -Benchmark.ips do |x| - x.config(options) - - x.report("Deep fetch") { event.get("[foo][bar][foobar]") } -end diff --git a/tools/benchmark/event_sprintf.rb b/tools/benchmark/event_sprintf.rb deleted file mode 100644 index 9bce01d6b..000000000 --- a/tools/benchmark/event_sprintf.rb +++ /dev/null @@ -1,51 +0,0 @@ -# encoding: utf-8 -require "benchmark/ips" -require "lib/logstash/event" - -options = { :time => 10, :warmup => 10 } -puts "Same Event instance" -Benchmark.ips do |x| - x.config(options) - event = LogStash::Event.new("foo" => "bar", - "foobar" => "morebar") - - x.report("Complex cached: Event#sprintf") { event.sprintf("/first/%{foo}/%{foobar}/%{+YYY-mm-dd}") } - x.report("Date only cached: Event#sprintf") { event.sprintf("%{+YYY-mm-dd}") } - x.report("string only cached: Event#sprintf") { event.sprintf("bleh") } - x.report("key only cached: Event#sprintf") { event.sprintf("%{foo}") } - x.compare! -end - -puts "New Event on each iteration" -Benchmark.ips do |x| - x.config(options) - - - x.report("Complex cached: Event#sprintf") do - event = LogStash::Event.new("foo" => "bar", - "foobar" => "morebar") - event.sprintf("/first/%{foo}/%{foobar}/%{+YYY-mm-dd}") - end - - - x.report("Date only cached: Event#sprintf") do - event = LogStash::Event.new("foo" => "bar", - "foobar" => "morebar") - - event.sprintf("%{+YYY-mm-dd}") - end - - x.report("string only cached: Event#sprintf") do - event = LogStash::Event.new("foo" => "bar", - "foobar" => "morebar") - event.sprintf("bleh") - end - - x.report("key only cached: Event#sprintf") do - event = LogStash::Event.new("foo" => "bar", - "foobar" => "morebar") - event.sprintf("%{foo}") - end - - x.compare! -end