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 & ...
Lots of Ways
Lots of Approaches

Faster App Server ii Profiling Code
Output Compression ii UsingAJAX/ COMET
A Stateful Sys...
Low Hanging Fruit

ii Club into three categories: 
it Improve your code
if!  Easy at first,  then very hard. 
'5 Improve y...
Low Hanging Fruit

It Improve your hardware

«I Only Rich People will build Rich Internet
Applications. 

it One thing in ...
Intelligent Caching works wonders

Caching: The Holy Grail
Lots of Ways
Lots of Approaches

Faster App Server iii Profiling Code
Output Compression it UsingAjAX/ COMET
A Stateful Sys...
Interlude One

A bit of a treat
Performance Testing

0 http_| oad,  ab,  httperfi 

0 httperf --num-conns= x --rate= y --
host= |oca| host --uri= /

0 Meas...
Interlude Two

Testing
How do I? 

Talking framework/ language/ platform
agnostic

I’ll focus on Rails,  but generalizations are
easy to come by
...
Fragment Caching

ii Assemble Portions of a Page
8) Reduce Computation
iii Lovely Rails idiom

it <% cache params,  expiry...
Page Caching

Cache the whole page

  Serve as static HTML by a frontend

webserver bypassing all framework code
Blazingly...
Page Caching Reloaded

4! Works for dynamic pages
* Reasonable amount of user-specific content
4! Axiom: 

1* The meat of a...
Solution

it Load navigation dynamically after page load

*1! The page loads,  the content is displayed and
unobtrusive ch...
Implementation

ii hlnclude
9* Lighttpd

it Lua (scripting lang like Ruby,  Python,  but
FAST)

Ii Memcached
hlnclude

-iii <hx: inc| ude src= "/src/ to/ dynamic-
content''></ hx: inc| ude>

4% Uses Javascript to load dynamic conte...
So Cache Away! 

ii Convert partials to a dummy action: 
it def personal
it render zpartial = > 'top_bar/ show’
W end. 
it...
Interlude Three

Magic
What did we do? 

A Slow to Fast

Caching is a lower hanging fruit:  It's easy to do
Surprisingly good results

hlnclude s...
Limitations

0 Usability:  Don't surprise the user with randomly changing
content

0 An elegant way to clean page caches w...
Finis

Questions?
Upcoming SlideShare
Loading in...5
×

The One True Way to Make Your Web Applications Quicker

2,964

Published on

My presentation at Barcamp Delhi 2

Published in: Technology
1 Comment
7 Likes
Statistics
Notes
  • Audio: http://s3.amazonaws.com/barcampaudio/vishnu_making_webapps_faster.mp3
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
2,964
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
1
Likes
7
Embeds 0
No embeds

No notes for slide

Transcript of "The One True Way to Make Your Web Applications Quicker"

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

×