Created
August 9, 2010 16:19
-
-
Save bluemonk/515648 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
| n = 50_000 | |
| Benchmark.bm do|b| | |
| b.report("ipaddr ") do | |
| n.times { IPAddr.new("192.168.10.100").to_s } | |
| end | |
| b.report("ipaddress parse ") do | |
| n.times { IPAddress.parse("192.168.10.100").to_s } | |
| end | |
| b.report("ipaddress ipv4 ") do | |
| n.times { IPAddress::IPv4.new("192.168.10.100").to_s } | |
| end | |
| end | |
| user system total real | |
| ipaddr 12.680000 3.750000 16.430000 ( 17.251509) | |
| ipaddress parse 13.090000 1.550000 14.640000 ( 15.311803) | |
| ipaddress ipv4 12.490000 1.310000 13.800000 ( 14.335803) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment