-
-
Save rue/832ccf0b01d488079fdb to your computer and use it in GitHub Desktop.
URI.build
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
1[22] pry(main)> u = ->() { 10_000.times { uri = URI::HTTP.build :host => "www.example.com", :path => "/foo/bar" } } | |
=> #<Proc:0x007fd474b2b8f8@(pry):28 (lambda)> | |
[23] pry(main)> s = ->() { 10_000.times { str = "http://www.example.com/" << "foo/bar" } } | |
=> #<Proc:0x007fd474b47260@(pry):29 (lambda)> | |
[24] pry(main)> Benchmark.bmbm {|b| b.report &u; b.report &s }; | |
Rehearsal ------------------------------------ | |
0.510000 0.000000 0.510000 ( 0.507082) | |
0.010000 0.000000 0.010000 ( 0.014184) | |
--------------------------- total: 0.520000sec | |
user system total real | |
0.500000 0.000000 0.500000 ( 0.502809) | |
0.010000 0.000000 0.010000 ( 0.006459) | |
[25] pry(main)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment