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
require 'benchmark' | |
data = (0..50_000_000) | |
Benchmark.bm do |x| | |
x.report(:find) { data.find {|number| number > 40_000_000 } } | |
x.report(:bsearch) { data.bsearch {|number| number > 40_000_000 } } | |
end | |
user system total real |
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
require 'benchmark' | |
data = (0..50_000_000) | |
Benchmark.bm do |x| | |
x.report(:find) { data.find {|number| number > 40_000_000 } } | |
x.report(:bsearch) { data.bsearch {|number| number > 40_000_000 } } | |
end | |
user system total real |
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
{ | |
"feeds":[ | |
{ | |
"restriction_level":"public", | |
"photos":[ | |
{ | |
"post_id":1, | |
"photo":{ | |
"web_m_retina":"/uploads/post_photo/photo/bc003114/76eaa3f5/6e4d375e/a1efd84e/web_m_retina_1505067265-1d27fa79.jpg", | |
"web_m":"/uploads/post_photo/photo/bc003114/76eaa3f5/6e4d375e/a1efd84e/web_m_1505067265-1d27fa79.jpg", |
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
module Yam | |
class ActionControllerLogger < YamLogger | |
def self.subscribe | |
ActiveSupport::Notifications.subscribe "process_action.action_controller" do |*args| | |
event = ActiveSupport::Notifications::Event.new *args | |
self.structure(event.payload,event.duration, event.name) | |
end | |
end |
NewerOlder