mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 15:25:35 +08:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
24 lines
620 B
Ruby
24 lines
620 B
Ruby
# frozen_string_literal: true
|
|
|
|
# simple script to measure memory at boot
|
|
|
|
if ENV['RAILS_ENV'] != "production"
|
|
exec "RAILS_ENV=production ruby #{__FILE__}"
|
|
end
|
|
|
|
require 'memory_profiler'
|
|
|
|
MemoryProfiler.report do
|
|
require File.expand_path("../../config/environment", __FILE__)
|
|
|
|
Rails.application.routes.recognize_path('abc') rescue nil
|
|
|
|
# load up the yaml for the localization bits, in master process
|
|
I18n.t(:posts)
|
|
|
|
# load up all models and schema
|
|
(ActiveRecord::Base.connection.tables - %w[schema_migrations versions]).each do |table|
|
|
table.classify.constantize.first rescue nil
|
|
end
|
|
end.pretty_print
|