Skip to content

Instantly share code, notes, and snippets.

@igaiga
Last active July 31, 2016 02:34
Show Gist options
  • Save igaiga/2d3657830b987c08ed59859553f3a56f to your computer and use it in GitHub Desktop.
Save igaiga/2d3657830b987c08ed59859553f3a56f to your computer and use it in GitHub Desktop.
# 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