Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Search Gists
Sign in Sign up

Instantly share code, notes, and snippets.

@keating
CreatedJanuary 12, 2013 09:31
    • Star(0)You must be signed in to star a gist
    • Fork(0)You must be signed in to fork a gist
    Save keating/4516928 to your computer and use it in GitHub Desktop.
    测试JRuby性能代码 Codes for test JRuby performance || Comparing ruby1.9 and JRuby performance
    2.times.map{
    Thread.new{whiletruedoend}
    }.each(&:join)
    # encoding: utf-8
    require'mechanize'
    agent=Mechanize.new
    page=agent.get('http://localhost:3000/login')
    form=page.forms[0]
    form["user_session[login]"]="user_cy"
    form["user_session[password]"]="user_cy_pw"
    form.submit
    100.times.eachdo |i|
    putsi
    page=agent.get('http://localhost:3000/cy_maps?query=true')
    end
    require'benchmark'
    require"open-uri"
    loop{
    putsBenchmark.measure{
    html=open("http://localhost:3000",:read_timeout=>1).read
    }
    sleep1
    }
    Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

    [8]ページ先頭

    ©2009-2025 Movatter.jp