Matchu
7948974949
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! |
||
---|---|---|
.. | ||
application_controller.rb | ||
campaigns_controller.rb | ||
closet_hangers_controller.rb | ||
closet_lists_controller.rb | ||
contributions_controller.rb | ||
donation_features_controller.rb | ||
donations_controller.rb | ||
items_controller.rb | ||
locales_controller.rb | ||
neopets_connections_controller.rb | ||
neopets_page_import_tasks_controller.rb | ||
neopets_users_controller.rb | ||
outfits_controller.rb | ||
pet_attributes_controller.rb | ||
pet_types_controller.rb | ||
pets_controller.rb | ||
sitemap_controller.rb | ||
static_controller.rb | ||
swf_assets_controller.rb | ||
users_controller.rb | ||
zones_controller.rb |