• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

The One True Way to Make Your Web Applications Quicker

on

  • 5,690 views

My presentation at Barcamp Delhi 2

My presentation at Barcamp Delhi 2

Statistics

Views

Total Views
5,690
Views on SlideShare
5,658
Embed Views
32

Actions

Likes
7
Downloads
0
Comments
1

3 Embeds 32

http://vysnu.com 30
http://www.vysnu.com 1
http://www.techgig.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Audio: http://s3.amazonaws.com/barcampaudio/vishnu_making_webapps_faster.mp3
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    The One True Way to Make Your Web Applications Quicker The One True Way to Make Your Web Applications Quicker Presentation Transcript

    • The One True Way to Make Your Web Apps Quicker! Vishnu Gopal
    • Me • Born and brought up a Keralite. Mallu. • Worked in the Mobile VAS sector, founded Torque, torque.co.in • Uzanto & SlideShare • www.vish.in
    • Lots of Ways Lots of Approaches • Profiling Code • Faster App Server • Using AJAX/COMET • Output Compression • Caching • A Stateful System • Better Hardware • A better web language • Not using Rich Media • Optimizing images
    • Low Hanging Fruit • Club into three categories: • Improve your code • Easy at first, then very hard. • Improve your dependencies • Most often impossible to do
    • Low Hanging Fruit • Improve your hardware • Only Rich People will build Rich Internet Applications. • One thing in the list quite doesn’t fit
    • Intelligent Caching works wonders Caching: The Holy Grail
    • Lots of Ways Lots of Approaches • Profiling Code • Faster App Server • Using AJAX/COMET • Output Compression • Caching • A Stateful System • Better Hardware • A better web language • Not using Rich Media • Optimizing images
    • Interlude One A bit of a treat
    • Performance Testing • http_load, ab, httperf, ... • httperf --num-conns=x --rate=y -- host=localhost --uri=/ • Measure a page which is a good indicator of your app (your home page would be nice)
    • Interlude Two Testing
    • How do I? • Talking framework/language/platform agnostic • I’ll focus on Rails, but generalizations are easy to come by • Caching fragments • Memcached
    • Fragment Caching • Assemble Portions of a Page • Reduce Computation • Lovely Rails idiom • <% cache params, expiry do %> and <% end %> around the block.
    • Page Caching • Cache the whole page • Serve as static HTML by a frontend webserver bypassing all framework code • Blazingly fast • Dynamic portions unique to a user are a problem
    • Page Caching Reloaded • Works for dynamic pages • Reasonable amount of user-specific content • Axiom: • The meat of a page is never its navigation: and content is usually not user-specific. • Why sacrifice speed for navigation?
    • Solution • Load navigation dynamically after page load • The page loads, the content is displayed and unobtrusive changes are made for personalization • Target areas: high traffic areas of a webapp where page caching will be uber cool
    • Implementation • hInclude • Lighttpd • Lua (scripting lang like Ruby, Python, but FAST) • Memcached
    • hInclude • <hx:include src="/src/to/dynamic- content"></hx:include> • Uses Javascript to load dynamic content in the background and update. • Seamless for small updates (feels like page loading)
    • So Cache Away! • Convert partials to a dummy action: • def personal • render :partial => 'top_bar/show' • end. • Call that using hInclude • Activate Page Caching, and..
    • Interlude Three Magic
    • What did we do? • Slow to Fast • Caching is a lower hanging fruit: It’s easy to do • Surprisingly good results • hInclude small dynamic portions for really fast pages
    • Limitations • Usability: Don’t surprise the user with randomly changing content. • An elegant way to clean page caches would be nice. • Another javascript library!
    • Finis Questions?