Instantly share code, notes, and snippets.
Save keating/4516928 to your computer and use it in GitHub Desktop.
测试JRuby性能代码 Codes for test JRuby performance || Comparing ruby1.9 and JRuby performance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2.times.map{ | |
Thread.new{whiletruedoend} | |
}.each(&:join) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
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