Last active
July 31, 2016 02:34
-
-
Save igaiga/2d3657830b987c08ed59859553f3a56f 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
# This is not a very beautiful code, but it's just an example... | |
# And it kinda works... | |
require 'benchmark/ips' | |
Rails.application.config.after_initialize do | |
Rails.application.extend Module.new { | |
def call(e) | |
super | |
p before: GC.stat | |
# RUBY_GC_HEAP_INIT_ SLOTS=1000000 + GC.disable | |
Benchmark.ips do |x| | |
x.report('Rails.application#call') do | |
super | |
end | |
end | |
p before: GC.stat | |
super # メモ:2回super呼ぶ? | |
end | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment