Skip to content

Instantly share code, notes, and snippets.

@jeremy
Forked from code/active_support_test.rb
Created November 23, 2008 04:08
Show Gist options
  • Save jeremy/28027 to your computer and use it in GitHub Desktop.
Save jeremy/28027 to your computer and use it in GitHub Desktop.
# $ ruby -Ilib active_support_test.rb
# ActiveSupport eating 2214 KB, loaded in 92 ms
require 'rubygems'
unless ENV['stdlib']
%w( active_support/vendor English base64 benchmark bigdecimal blankslate
builder cgi date date/format digest/md5 drb enumerator fast_xs fcntl
fileutils iconv kconv logger memcache mocha monitor openssl pathname
rational rexml/document securerandom set singleton stringio strscan
tempfile test/unit/error test/unit/testcase thread time tmpdir tzinfo
xmlsimple yaml ).each { |f| require f }
end
GC.enable_stats
GC.start
before = GC.allocated_size
elapsed = Benchmark.realtime { require 'active_support' }
GC.start
after = GC.allocated_size
puts "ActiveSupport eating %d KB, loaded in %d ms" % [(after - before) / 1024.0, elapsed * 1000]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment