02 Sep 2012
Richard Huang
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"
Read More
Tags
performance
30 Oct 2011
Richard Huang
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.
Read More
Tags
migration
performance
23 Jun 2011
Angelo Capilleri
Use select with has_many and belongs_to on Active Record Associations
Read More
Tags
refactor
model
performance
22 Nov 2010
Richard Huang
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.
Read More
Tags
performance
19 Oct 2010
Richard Huang
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.
Read More
Tags
performance
query
09 Sep 2010
Richard Huang
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.
Read More
Tags
model
performance
task
30 Aug 2010
Richard Huang
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.
Read More
Tags
view
performance
assets
javascript
15 Aug 2010
Richard Huang
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.
Read More
Tags
plugin
performance
css sprite
convention
assets
31 Jul 2010
Richard Huang
Use asset host for cookie-free domains for components, that make your components load faster.
Read More
Tags
performance
assets