Last active
August 29, 2015 14:04
-
-
Save ascendbruce/abb001a76d9a24e15465 to your computer and use it in GitHub Desktop.
Revisions
-
ascendbruce revised this gist
Aug 1, 2014 . 1 changed file with 8 additions and 8 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 @@ -1,25 +1,25 @@ # Rehearsal 不算入 user system total real unless blank? (actually present) 0.700000 0.000000 0.700000 ( 0.703966) unless blank? (actually blank) 1.390000 0.000000 1.390000 ( 1.399121) if present? (actually present) 0.790000 0.000000 0.790000 ( 0.795483) if present? (actually blank) 1.410000 0.000000 1.410000 ( 1.406053) user system total real unless blank? (actually present) 0.740000 0.000000 0.740000 ( 0.741436) unless blank? (actually blank) 1.400000 0.000000 1.400000 ( 1.407183) if present? (actually present) 0.780000 0.000000 0.780000 ( 0.775220) if present? (actually blank) 1.420000 0.010000 1.430000 ( 1.431337) # if/unless 上下對調 user system total real if present? (actually present) 0.750000 0.000000 0.750000 ( 0.745319) if present? (actually blank) 1.430000 0.000000 1.430000 ( 1.436408) unless blank? (actually present) 0.660000 0.000000 0.660000 ( 0.659880) unless blank? (actually blank) 1.290000 0.000000 1.290000 ( 1.295552) user system total real if present? (actually present) 0.730000 0.010000 0.740000 ( 0.739630) if present? (actually blank) 1.440000 0.000000 1.440000 ( 1.433405) unless blank? (actually present) 0.650000 0.000000 0.650000 ( 0.654705) unless blank? (actually blank) 1.370000 0.000000 1.370000 ( 1.368957) -
ascendbruce revised this gist
Aug 1, 2014 . 2 changed files with 25 additions and 26 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 @@ -5,32 +5,33 @@ Benchmark.bmbm do |x| x.report("if present? (actually present)") do TIMES.times do if "1".present? end end end x.report("if present? (actually blank)") do TIMES.times do if "".present? end end end x.report("unless blank? (actually present)") do TIMES.times do unless "1".blank? end end end x.report("unless blank? (actually blank)") do TIMES.times do unless "".blank? end end end end 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,27 +1,25 @@ # Rehearsal 不算入 user system total real unless blank? (actually present) 0.700000 0.000000 0.700000 ( 0.703966) unless blank? (actually blank) 1.390000 0.000000 1.390000 ( 1.399121) if present? (actually present) 0.790000 0.000000 0.790000 ( 0.795483) if present? (actually blank) 1.410000 0.000000 1.410000 ( 1.406053) user system total real unless blank? (actually present) 0.740000 0.000000 0.740000 ( 0.741436) unless blank? (actually blank) 1.400000 0.000000 1.400000 ( 1.407183) if present? (actually present) 0.780000 0.000000 0.780000 ( 0.775220) if present? (actually blank) 1.420000 0.010000 1.430000 ( 1.431337) # if/unless 上下對調 user system total real if present? (actually present) 0.750000 0.000000 0.750000 ( 0.745319) if present? (actually blank) 1.430000 0.000000 1.430000 ( 1.436408) unless blank? (actually present) 0.660000 0.000000 0.660000 ( 0.659880) unless blank? (actually blank) 1.290000 0.000000 1.290000 ( 1.295552) user system total real if present? (actually present) 0.730000 0.010000 0.740000 ( 0.739630) if present? (actually blank) 1.440000 0.000000 1.440000 ( 1.433405) unless blank? (actually present) 0.650000 0.000000 0.650000 ( 0.654705) unless blank? (actually blank) 1.370000 0.000000 1.370000 ( 1.368957) -
ascendbruce revised this gist
Aug 1, 2014 . 1 changed file with 4 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 @@ -1,3 +1,5 @@ # Rehearsal 不算入 user system total real unless blank? (actually blank) 0.700000 0.000000 0.700000 ( 0.703966) unless blank? (actually present) 1.390000 0.000000 1.390000 ( 1.399121) @@ -10,6 +12,8 @@ unless blank? (actually present) 1.400000 0.000000 1.400000 ( 1.407183) if present? (actually blank) 0.780000 0.000000 0.780000 ( 0.775220) if present? (actually present) 1.420000 0.010000 1.430000 ( 1.431337) # if/unless 上下對調 user system total real if present? (actually blank) 0.750000 0.000000 0.750000 ( 0.745319) if present? (actually present) 1.430000 0.000000 1.430000 ( 1.436408) -
ascendbruce created this gist
Aug 1, 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,36 @@ require 'benchmark' require "active_support/core_ext/object/blank" TIMES = 1000000 Benchmark.bmbm do |x| x.report("if present? (actually blank)") do TIMES.times do if "1".present? end end end x.report("if present? (actually present)") do TIMES.times do if "".present? end end end x.report("unless blank? (actually blank)") do TIMES.times do unless "1".blank? end end end x.report("unless blank? (actually present)") do TIMES.times do unless "".blank? end end end end 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,23 @@ user system total real unless blank? (actually blank) 0.700000 0.000000 0.700000 ( 0.703966) unless blank? (actually present) 1.390000 0.000000 1.390000 ( 1.399121) if present? (actually blank) 0.790000 0.000000 0.790000 ( 0.795483) if present? (actually present) 1.410000 0.000000 1.410000 ( 1.406053) user system total real unless blank? (actually blank) 0.740000 0.000000 0.740000 ( 0.741436) unless blank? (actually present) 1.400000 0.000000 1.400000 ( 1.407183) if present? (actually blank) 0.780000 0.000000 0.780000 ( 0.775220) if present? (actually present) 1.420000 0.010000 1.430000 ( 1.431337) user system total real if present? (actually blank) 0.750000 0.000000 0.750000 ( 0.745319) if present? (actually present) 1.430000 0.000000 1.430000 ( 1.436408) unless blank? (actually blank) 0.660000 0.000000 0.660000 ( 0.659880) unless blank? (actually present) 1.290000 0.000000 1.290000 ( 1.295552) user system total real if present? (actually blank) 0.730000 0.010000 0.740000 ( 0.739630) if present? (actually present) 1.440000 0.000000 1.440000 ( 1.433405) unless blank? (actually blank) 0.650000 0.000000 0.650000 ( 0.654705) unless blank? (actually present) 1.370000 0.000000 1.370000 ( 1.368957)