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! |
||
---|---|---|
.. | ||
assets | ||
controllers | ||
helpers | ||
javascript | ||
mailers | ||
models | ||
views |