Created
          April 3, 2009 00:58 
        
      - 
      
 - 
        
Save markbates/89590 to your computer and use it in GitHub Desktop.  
  
    
      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 'pcp_middleware' | |
| require 'benchmark' | |
| configatron.sr.pcp.default_partner = 'www' | |
| configatron.sr.pcp.default_configuration_name = 'site' | |
| configatron.sr.pcp.partner.cache = false | |
| configatron.sr.pcp.partner.site = 'https://test_user:abc123@pcp.stage.secondrotation.com' | |
| res = Benchmark.realtime do | |
| 10.times do | |
| partner = SR::PCP::Partner.find_by_subdomain(:www) | |
| puts partner.object_id | |
| end | |
| end | |
| avg = res/10.0 | |
| puts "Avg response: #{avg} (false)" | |
| puts "Total response: #{res} (false)" | |
| puts "---------------------------------" | |
| configatron.sr.pcp.partner.cache = true | |
| res = Benchmark.realtime do | |
| 10.times do | |
| partner = SR::PCP::Partner.find_by_subdomain(:www) | |
| puts partner.object_id | |
| end | |
| end | |
| avg = res/10.0 | |
| puts "Avg response: #{avg} (true)" | |
| puts "Total response: #{res} (true)" | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment