Tag performance

17 votes

10828 views

Use asset_host for production server

Use asset host for cookie-free domains for components, that make your components load faster.

Comments

flyerhzm

10 votes

8516 views

Use css sprite automatically

Using css sprite can reduce a large number of http requests, so it makes the web page loaded much faster. It it painful to composite a lot of images manually, do it automatically.

Comments

flyerhzm

9 votes

12913 views

Put scripts at the bottom

Do you experience that your website renders slow due to loading a lot of javascripts, especially loading some third-party javascripts? Move script tags to the bottom of body can speed up the render of your website.

Comments

flyerhzm

9 votes

10281 views

Use batched finder for large data query

If you want to do a large data query such as finding all the 10,000,000 users to send email to them, you should use batched finder to avoid eating too much memory.

Comments

flyerhzm

5 votes

14140 views

Select specific fields for performance

In a system like forum, the title and body is displayed on show page, but only title is on index page. You should use select in query to speed up the query and save memory.

Comments

flyerhzm

34 votes

34682 views

Use memoization

Memoization is an optimization technique used primarily to speed up computer programs by having function calls avoid repeating the calculation of results for previously-processed inputs. In rails, you can easily use memoize which is inherited from ActiveSupport::Memoizable.

Comments

flyerhzm

7 votes

15950 views

Active Record Query Interface Optimization

Use select with has_many and belongs_to on Active Record Associations

Comments

angelo capilleri

3 votes

18773 views

Optimize db migration

rails migration provides a convenient way to alter database structure, you can easily add, change and drop column to a existing table, but when the data in existing table are huge, it will take a long time to alter existing table, you should try to merge/optimize the db alter sql statements.

Comments

flyerhzm

4 votes

12507 views

rolling out with feature flags

Sometimes you may face the situation that some features will be released, but you are not sure if it is friendly to end user, or if it will lead to performance issues, at that time you should use what we called "feature flags"

Comments

flyerhzm