1
0
Fork 0
forked from OpenNeo/impress
impress/app/models
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
..
item Delete unused item proxy class 2023-10-25 12:55:30 -07:00
application_record.rb Upgrade to Rails 5.2.8.1 2023-10-23 19:05:05 -07:00
auth_record.rb Add AuthUser model, connecting to openneo_id db 2023-10-23 19:05:07 -07:00
auth_user.rb Clarify the error behavior on AuthUser syncing 2023-10-23 19:05:08 -07:00
campaign.rb Upgrade to Rails 5.2.8.1 2023-10-23 19:05:05 -07:00
closet_hanger.rb Do preloading manually on user list pages, to reduce memory usage 2023-10-27 19:42:02 -07:00
closet_list.rb Do preloading manually on user list pages, to reduce memory usage 2023-10-27 19:42:02 -07:00
closet_visibility.rb Cache trade info on items#show, finally! I think it's the performance culprit. 2013-12-27 14:49:46 -05:00
color.rb Remove sanitize_sql_like monkey-patch 2023-10-23 19:05:07 -07:00
contribution.rb Upgrade to Rails 5.2.8.1 2023-10-23 19:05:05 -07:00
donation.rb Mark some more relationships as optional 2023-10-23 19:05:07 -07:00
donation_feature.rb Mark some more relationships as optional 2023-10-23 19:05:07 -07:00
fragment_localization.rb i18n for outfits#new (and layouts#application), including caching 2013-01-24 18:23:18 -06:00
image.rb Delete Camo references & Addressable gem 2023-10-23 19:05:05 -07:00
item.rb Delete unused item proxy class 2023-10-25 12:55:30 -07:00
item_outfit_relationship.rb Upgrade to Rails 5.2.8.1 2023-10-23 19:05:05 -07:00
neopets_connection.rb Upgrade to Rails 5.2.8.1 2023-10-23 19:05:05 -07:00
neopets_page.rb Update most URLs to use HTTPS 2023-10-25 15:22:57 -07:00
neopets_user.rb Update most URLs to use HTTPS 2023-10-25 15:22:57 -07:00
outfit.rb Remove slightly-broken edit outfit links from user outfits page 2023-10-24 18:05:51 -07:00
parent_swf_asset_relationship.rb Upgrade to Rails 5.2.8.1 2023-10-23 19:05:05 -07:00
pet.rb Skip item translations when modeling 2023-10-23 19:05:10 -07:00
pet_attribute.rb capitalize each word of a species/color name (for Swamp Gas) 2011-07-12 18:22:16 -04:00
pet_state.rb Update most URLs to use HTTPS 2023-10-25 15:22:57 -07:00
pet_type.rb Update most URLs to use HTTPS 2023-10-25 15:22:57 -07:00
pretty_param.rb parameterize user params like items, plus a cleaner parameterization scheme 2011-07-26 18:49:52 -04:00
species.rb Remove sanitize_sql_like monkey-patch 2023-10-23 19:05:07 -07:00
static_resource.rb attempt to fix new species_support_ids format. sigh. 2013-01-23 00:25:09 -06:00
swf_asset.rb Skip item translations when modeling 2023-10-23 19:05:10 -07:00
user.rb Clarify the error behavior on AuthUser syncing 2023-10-23 19:05:08 -07:00
zone.rb Fix bug with Arel ordering 2023-10-23 19:05:05 -07:00