class BenchPages

Public Class Methods

main() click to toggle source
# File vendor/qwik/lib/qwik/bench-page.rb, line 14
def self.main
  b = self.new
  b.setup
  b.bench_all
  b.teardown
end

Public Instance Methods

bench_all() click to toggle source
# File vendor/qwik/lib/qwik/bench-page.rb, line 35
def bench_all
  n = 10000
  page = @pages['TextFormat']
  benchmark {
    n.times {
      title = page.get_title
      #title = page.key
    }
  }
  @pages.erase_all if @pages
end
setup() click to toggle source
# File vendor/qwik/lib/qwik/bench-page.rb, line 21
def setup
  @config = Qwik::Config.new
  @dir = 'test/'.path
  @wwwdir = @dir

  # setup dir
  @wwwdir = 'www/'.path
  @wwwdir.setup
  @dir = 'test/'.path
  @dir.setup

  @pages = Qwik::Pages.new(@config, @dir)
end