This file contains 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
0a1,259 | |
> Wed Aug 18 01:37:49 2010 NARUSE, Yui <naruse@ruby-lang.org> | |
> | |
> * regcomp.c: revert r26701; it introduces Bug #3681. | |
> [ruby-core:31677] | |
> | |
> Mon Aug 16 23:16:21 2010 Yusuke Endoh <mame@tsg.ne.jp> | |
> | |
> * NEWS: updated. a patch from Kazuhiro NISHIYAMA in [ruby-dev:42001]. | |
> |
This file contains 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 'httparty' | |
class Webservice | |
CANDIDATE = <<XML | |
<Candidate xmlns="com.mysite/2010/10/10" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> | |
<FirstName>%s</FirstName> | |
<LastName>%s</LastName> | |
<Email>%s</Email> | |
<Gender>%s</Gender> | |
</Candidate> |
This file contains 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
# The many ways to use curb to do http requests. | |
# | |
# These all share code, but are different code paths. | |
require 'curb' | |
url = "http://www.example.com" | |
c = Curl::Easy.new(url) | |
c.url = url |
This file contains 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 'peach' | |
require 'benchmark' | |
def process(n) | |
sleep(1) | |
n**n | |
end | |
n = (ARGV.first || 60).to_i |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Tracks</key> | |
<dict> | |
<key>1</key> | |
<dict> | |
<key>Track ID</key><integer>1</integer> | |
<key>Name</key><string>Test song name 0</string> |
This file contains 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
class TopLevel | |
module Constants | |
HelloWorld = "Hello, World!" | |
def self.hello_world | |
puts HelloWorld | |
end | |
end | |
end | |
TopLevel::Constants.class_eval do |
This file contains 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
class File | |
def self.buffer(path) | |
n = 0 | |
size = File.size( path ) | |
chunk = 2**16 | |
File.open(path, "rb") do |f| | |
while n < size | |
n += chunk | |
yield f.sysread( chunk ) | |
end |
This file contains 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
$ ruby -v | |
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux] | |
$ ruby -Ilib benchmarks/excon_vs.rb | |
[em-http-request, Excon, Excon (persistent), HTTParty, Net::HTTP, Net::HTTP (persistent), open-uri, RestClient, StreamlyFFI (persistent), Typhoeus] | |
+--------------------------+-----------+ | |
| tach | total | | |
+--------------------------+-----------+ | |
| Net::HTTP (persistent) | 2.288449 | |
This file contains 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
diff --git a/benchmarks/excon_vs.rb b/benchmarks/excon_vs.rb | |
index 5fa84e7..9f5e0cb 100644 | |
--- a/benchmarks/excon_vs.rb | |
+++ b/benchmarks/excon_vs.rb | |
@@ -69,15 +69,6 @@ with_server do | |
} | |
end | |
- tach('Excon') do | |
- Excon.get(url).body |
This file contains 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
$ ruby benchmarks/excon_vs_google.rb | |
[em-http-request, HTTParty, Net::HTTP, Net::HTTP (persistent), open-uri, RestClient, StreamlyFFI (persistent), Typhoeus, Excon, Excon (persistent)] | |
+--------------------------+-----------+ | |
| tach | total | | |
+--------------------------+-----------+ | |
| Excon | 7.614298 | | |
+--------------------------+-----------+ | |
| Typhoeus | 7.723362 | |