1
0
Fork 0
forked from OpenNeo/impress
impress/app/controllers
Matchu 7948974949 Do preloading manually on user list pages, to reduce memory usage
I used the new profiler tools on this page, and noticed a lot of
allocations in the Globalize library, which we use for translating
database records. I realized that we were loading all of the fields of
not just all of the items on the page, but all of their translation
records in all locales! We used to scrape data for lots of languages, so
that can be quite a lot!

Unfortunately, Rails's `includes` method to efficiently preload related
records always loads all fields, and simply can't be overridden.

So, in this change we write manual preloading code, to identify the
records we need, load them in big bulk queries, and assign them back to
the appropriate associations. Basically just what `includes` does, but
written out a bit more, to give us the chance to specify SELECT and
WHERE clauses!
2023-10-27 19:42:02 -07:00
..
application_controller.rb Add mini profiler to each page 2023-10-27 19:38:49 -07:00
campaigns_controller.rb new donate layout for post-2017 campaign 2018-01-18 17:14:02 -08:00
closet_hangers_controller.rb Do preloading manually on user list pages, to reduce memory usage 2023-10-27 19:42:02 -07:00
closet_lists_controller.rb Use flash[:notice] instead of flash[:success] 2023-10-23 19:05:07 -07:00
contributions_controller.rb remove N+1 queries in contributions#index 2013-01-25 15:23:48 -06:00
donation_features_controller.rb homepage outfit features 2014-09-10 15:38:26 -05:00
donations_controller.rb Use flash[:notice] instead of flash[:success] 2023-10-23 19:05:07 -07:00
items_controller.rb Upgrade to Rails 5.2.8.1 2023-10-23 19:05:05 -07:00
locales_controller.rb locale cookie should be long-term, not a session cookie 2013-01-24 18:24:33 -06:00
neopets_connections_controller.rb closet hangers index uses neopets connections dropdown 2014-01-18 22:50:14 -06:00
neopets_page_import_tasks_controller.rb Use flash[:notice] instead of flash[:success] 2023-10-23 19:05:07 -07:00
neopets_users_controller.rb Use flash[:notice] instead of flash[:success] 2023-10-23 19:05:07 -07:00
outfits_controller.rb Delete outfits/show page, point to the editor instead 2023-10-24 18:02:18 -07:00
pet_attributes_controller.rb use funny ordering in wardrobe, too 2014-03-27 22:45:34 -05:00
pet_types_controller.rb a functioning wardrobe 2010-10-10 22:18:42 -04:00
pets_controller.rb Delete unused roulette feature 2023-10-24 19:05:18 -07:00
sitemap_controller.rb move from with_translations to includes(:translations), since we dont usually care about requiring 2013-01-24 18:26:00 -06:00
static_controller.rb yum, new campaigns 2015-08-05 19:26:12 -04:00
swf_assets_controller.rb Remove SWF conversion 2023-10-23 19:05:04 -07:00
users_controller.rb Use flash[:notice] instead of flash[:success] 2023-10-23 19:05:07 -07:00
zones_controller.rb Improve zones.json performance 2023-10-23 19:05:03 -07:00