Created
October 28, 2010 21:11
-
-
Save sferik/652330 to your computer and use it in GitHub Desktop.
Twitter API SSL Benchmarks
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 '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