Created
October 7, 2010 13:46
Revisions
-
niko created this gist
Oct 7, 2010 .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,15 @@ module Kernel def memory_consumption `ps -o rss= -p #{Process.pid}`.to_i end alias :require_without_profiling :require def require(file,*args) mem_before = memory_consumption require_without_profiling(file, *args) mem_after = memory_consumption puts "Loaded #{file} #{mem_before} -> #{mem_after} (#{mem_after - mem_before})" end end