"Compilation : Increase performance of any Application "

Short Term

  • Asset Packager
  • Caching – All levels
    • Memcache
    • Action
    • Active Record
    • Fragment
  • combine CSS and JS files with the :cache option
  • avoid HTTP 302 redirects
  • use secondary indices for your database (Rails won’t do this for you)
  • increase SQL-Server query cache
  • SSL only where required
  • Load assets from Subdomain/ different instance , make these environments cookie free
  • Iframe the videos in app
  • Reduce the HTTP request to any page
  • Put all style-sheets at top

    • and compress them to single CSS
    • No Inline CSS
  • Put Scripts to the bottom

    • and compress them to single JS
    • Remove Duplicate scripts
    • No Inline JS
  • Reduce DNS lookups
  • Avoid 301 Redirects
  • Cache and reduce size of Favicon
  • Dont scale images in HTML
  • No empty img src=””
  • Get rid of the extra/unused meta-tags
  • Trim out the white chars
  • Remove the comments
  • Use short names for media included in your website(images, flash files, movies and others)
  • Use relative links instead of full url links


Ongoing :

  • Optimize queries, eager loading of associations with :include and JOIN
  • group operations in a transaction
  • use a Sphinx search server for searching
  • Minimize Response Size
    • SELECT only the needed columns
    • LIMIT the number of return datasets (pagination)
  • Dont use Before Filters for large data
  • Host the server nearer to the user
  • Add Expiry to Header 
  • no 404
  • Reduce Cokiee size


Long term

  • AWS – EC2 AMAZON – Content Delivery Network
  • Compress Assets YUI 
  • use CSS Sprites
  • replace full HTTP requests by XHR requests (i.e. Ajax calls)
  • use counter cache columns
  • denormalize (e.g. comma-separated list of ids in single fields to cache queries)
  • precalculate data through rake tasks
  • Migrating to Rails 3 and Ruby 1.9.2
  • Image caching/compressing
  • Redis
  • Cache option enabled for Js and CSS
  • Configure Etags
  • Cache AJAX requests
  • Use a GET request even if we are doing a AJAX, depending on whether we need to only fetch data or post also
  • Post load components – YUI image loader
  • Pre load some components
  • Reduce number of DOM elements
  • Move irelevant or non-unique content into subpages or popups
  • Remove site-wide links from your footer
  • No tables, tableless design

Ways to test

  • Benchmarking
  • Profiling
  • New Relic
  • Rails Log Analyser
  • Ruby Prof
  • Load Less SQL queries
  • YSLOW

Bibliography



Advertisements
"Compilation : Increase performance of any Application "

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s