aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/gems/fast_gettext-0.5.10/benchmark/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/gems/fast_gettext-0.5.10/benchmark/base.rb')
-rw-r--r--vendor/gems/fast_gettext-0.5.10/benchmark/base.rb42
1 files changed, 0 insertions, 42 deletions
diff --git a/vendor/gems/fast_gettext-0.5.10/benchmark/base.rb b/vendor/gems/fast_gettext-0.5.10/benchmark/base.rb
deleted file mode 100644
index a3fead192..000000000
--- a/vendor/gems/fast_gettext-0.5.10/benchmark/base.rb
+++ /dev/null
@@ -1,42 +0,0 @@
-require 'rubygems'
-require 'benchmark'
-
-RUNS = 50_0000
-DEFAULTS = {:memory=>0}
-
-def locale_folder(domain)
- path = case domain
- when 'test' then File.join(File.expand_path(File.dirname(__FILE__)),'..','spec','locale')
- when 'large' then File.join(File.expand_path(File.dirname(__FILE__)),'locale')
- end
-
- mo = File.join(path,'de','LC_MESSAGES',"#{domain}.mo")
- raise unless File.exist?(mo)
- path
-end
-
-def results_test(&block)
- print "#{(result(&block)).to_s.strip.split(' ').first}s / #{memory}K <-> "
-end
-
-def results_large
- print "#{(result {_('login') == 'anmelden'}).to_s.strip.split(' ').first}s / #{memory}K"
- puts ""
-end
-
-def result
- result =Benchmark.measure do
- RUNS.times do
- raise "not translated" unless yield
- end
- end
- result
-end
-
-def memory
- pid = Process.pid
- map = `pmap -d #{pid}`
- map.split("\n").last.strip.squeeze(' ').split(' ')[3].to_i - DEFAULTS[:memory]
-end
-
-DEFAULTS[:memory] = memory + 4 #4 => 0 for base calls \ No newline at end of file