Rakefile in anomaly-0.0.2 vs Rakefile in anomaly-0.0.3
- old
+ new
@@ -1,4 +1,17 @@
#!/usr/bin/env rake
require "bundler/gem_tasks"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new("spec")
+
+require "benchmark"
+require "anomaly"
+
+task :benchmark do
+ data = 1_000_000.times.map{ [rand, rand, rand, rand] }
+
+ Benchmark.bm do |x|
+ x.report { Anomaly::Detector.new(data) }
+ require "narray"
+ x.report { Anomaly::Detector.new(data) }
+ end
+end