Skip to content

@sferik /twitter_ssl_bench.rb
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Twitter API SSL Benchmarks
require 'rubygems'
require 'rbench'
require 'twitter'
class Bench
def self.setup
Twitter.configure do |config|
config.consumer_key = CONSUMER_KEY
config.consumer_secret = CONSUMER_SECRET
config.oauth_token = OAUTH_TOKEN
config.oauth_token_secret = OAUTH_TOKEN_SECRET
end
end
def self.no_ssl
Twitter.endpoint = 'http://api.twitter.com/1/'
Twitter.friends
end
def self.ssl
Twitter.endpoint = 'https://api.twitter.com/1/'
Twitter.friends
end
end
RBench.run(100) do
column :one, :title => "HTTP"
column :two, :title => "HTTPS"
Bench.setup
report "HTTP vs. HTTPS" do
one { Bench.no_ssl }
two { Bench.ssl }
end
end
__END__
HTTP | HTTPS |
------------------------------------------
HTTP vs. HTTPS 262.061 | 240.705 |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.