Last active
August 29, 2015 14:04
-
-
Save 13k/46662d1d048be1f34c36 to your computer and use it in GitHub Desktop.
Revisions
-
13k revised this gist
Aug 6, 2014 . 2 changed files with 18 additions and 18 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ x.report("<Symbol> => (<Symbol>, <String>)") do case state1 when :initial, "initial" a = 1 else a = 2 @@ -33,7 +33,7 @@ x.report("<String> => (<Symbol>, <String>)") do case state2 when :initial, "initial" a = 1 else a = 2 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 charactersOriginal file line number Diff line number Diff line change @@ -1,34 +1,34 @@ Calculating ------------------------------------- <Symbol> => (<String>, <Symbol>) 74453 i/100ms <Symbol> => (<Symbol>, <String>) 72922 i/100ms <String> => (<String>, <Symbol>) 69175 i/100ms <String> => (<Symbol>, <String>) 69552 i/100ms <Symbol>.to_s => (<String>, <Symbol>) 57608 i/100ms <Symbol>.to_s => (<Symbol>, <String>) 56134 i/100ms <String>.to_sym => (<String>, <Symbol>) 61364 i/100ms <String>.to_sym => (<Symbol>, <String>) 60929 i/100ms ------------------------------------------------- <Symbol> => (<String>, <Symbol>) 5759613.5 (±21.2%) i/s - 27249798 in 5.011084s <Symbol> => (<Symbol>, <String>) 5739427.9 (±20.7%) i/s - 27272828 in 5.005634s <String> => (<String>, <Symbol>) 4124374.2 (±19.2%) i/s - 19784050 in 5.011632s <String> => (<Symbol>, <String>) 4136960.2 (±19.5%) i/s - 19752768 in 5.000195s <Symbol>.to_s => (<String>, <Symbol>) 2675549.2 (±18.7%) i/s - 12904192 in 5.017881s <Symbol>.to_s => (<Symbol>, <String>) 2656961.9 (±17.9%) i/s - 12854686 in 5.016062s <String>.to_sym => (<String>, <Symbol>) 3368770.7 (±19.7%) i/s - 16138732 in 5.009987s <String>.to_sym => (<Symbol>, <String>) 3422990.3 (±18.9%) i/s - 16450830 in 5.008404s -
13k renamed this gist
Aug 6, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
13k revised this gist
Aug 6, 2014 . 1 changed file with 34 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ Calculating ------------------------------------- <Symbol> => (<String>, <Symbol>) 73875 i/100ms <Symbol> => (<Symbol>, <String>) 74186 i/100ms <String> => (<String>, <Symbol>) 70543 i/100ms <String> => (<Symbol>, <String>) 64242 i/100ms <Symbol>.to_s => (<String>, <Symbol>) 56082 i/100ms <Symbol>.to_s => (<Symbol>, <String>) 57367 i/100ms <String>.to_sym => (<String>, <Symbol>) 62482 i/100ms <String>.to_sym => (<Symbol>, <String>) 64720 i/100ms ------------------------------------------------- <Symbol> => (<String>, <Symbol>) 5568843.6 (±22.4%) i/s - 26151750 in 4.998684s <Symbol> => (<Symbol>, <String>) 5588055.1 (±22.2%) i/s - 26336030 in 5.000547s <String> => (<String>, <Symbol>) 4135383.0 (±19.7%) i/s - 19752040 in 5.006001s <String> => (<Symbol>, <String>) 4168500.0 (±19.3%) i/s - 19915020 in 4.997968s <Symbol>.to_s => (<String>, <Symbol>) 2677770.4 (±20.1%) i/s - 12786696 in 5.010613s <Symbol>.to_s => (<Symbol>, <String>) 2653803.5 (±19.4%) i/s - 12735474 in 5.016253s <String>.to_sym => (<String>, <Symbol>) 3434909.7 (±18.8%) i/s - 16557730 in 5.015742s <String>.to_sym => (<Symbol>, <String>) 3407837.0 (±20.1%) i/s - 16309440 in 5.011231s -
13k created this gist
Aug 6, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,78 @@ require "benchmark/ips" state1 = :initial state2 = "initial" Benchmark.ips do |x| x.report("<Symbol> => (<String>, <Symbol>)") do case state1 when "initial", :initial a = 1 else a = 2 end end x.report("<Symbol> => (<Symbol>, <String>)") do case state1 when "initial", :initial a = 1 else a = 2 end end x.report("<String> => (<String>, <Symbol>)") do case state2 when "initial", :initial a = 1 else a = 2 end end x.report("<String> => (<Symbol>, <String>)") do case state2 when "initial", :initial a = 1 else a = 2 end end x.report("<Symbol>.to_s => (<String>, <Symbol>)") do case state1.to_s when "initial", :initial a = 1 else a = 2 end end x.report("<Symbol>.to_s => (<Symbol>, <String>)") do case state1.to_s when :initial, "initial" a = 1 else a = 2 end end x.report("<String>.to_sym => (<String>, <Symbol>)") do case state2.to_sym when "initial", :initial a = 1 else a = 2 end end x.report("<String>.to_sym => (<Symbol>, <String>)") do case state2.to_sym when :initial, "initial" a = 1 else a = 2 end end end