Optimizing Perceived Performance

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.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    2 Favorites

    Optimizing Perceived Performance - Presentation Transcript

    1. Optimizing Perceived Performance Monday, March 23, 2009
    2. About Me Monday, March 23, 2009
    3. My Startup Monday, March 23, 2009
    4. DBDB Monday, March 23, 2009
    5. http://github.com/ dce/dbdb Monday, March 23, 2009
    6. http://github.com/ dce/dbdb public/javascripts/application.js Monday, March 23, 2009
    7. def bagfactor sleep(2) rand(50) / 10.0 end Monday, March 23, 2009
    8. It could happen to you Monday, March 23, 2009
    9. First Impressions Monday, March 23, 2009
    10. Up to... 0.1 second instantaneous 1 second responsive 10 seconds slow > 10 seconds gone – About Face 3 Monday, March 23, 2009
    11. Bring in the AJAX Monday, March 23, 2009
    12. Some Definitions Monday, March 23, 2009
    13. Progressive Enhancement Monday, March 23, 2009
    14. Unobtrusive Javascript Monday, March 23, 2009
    15. HIJAX Monday, March 23, 2009
    16. jQuery Monday, March 23, 2009
    17. class DbsController < ApplicationController def show @db = Db.find(params[:id]) respond_to do |format| format.html format.js do render :partial => \"profile\", :locals => { :db => @db } end end end end Monday, March 23, 2009
    18. $(\".db-list a\").click(function() { link = $(this); $.ajax({url: $(this).attr(\"href\"), success: function(src) { link.parents(\"dt\").after(src); link.unbind('click').click(function() { $(this).parents(\"dt\").next(\"dd\").toggle(); return false; }) } }); return false; }); Monday, March 23, 2009
    19. Make It Snappy Monday, March 23, 2009
    20. $(\".db-list a\").click(function() { link = $(this); link.parents(\"dt\").after('<dd class=\"spinner\"></dd>'); link.unbind(\"click\").click(function() { link.parents(\"dt\").next(\"dd\").slideToggle(); return false; }); $.ajax({url: link.attr(\"href\"), success: function(src) { link.parents(\"dt\").next(\"dd\").replaceWith(src); } }); return false; }); Monday, March 23, 2009
    21. Take Advantage of Downtime Monday, March 23, 2009
    22. Monday, March 23, 2009
    23. $(\".db-list a\").each(function() { $(this).parents(\"dt\").after(\"<dd class=\\\"spinner\\\"></dd>\") .next(\"dd\").hide(); }); $(\".db-list a\").click(function() { $(this).parents(\"dt\").next(\"dd\").slideToggle(); return false; }); $(\".db-list a:first\").each(function() { $(this).loadContentInOrder(); }); Monday, March 23, 2009
    24. jQuery.fn.loadContentInOrder = function() { link = this; $.ajax({url: this.attr(\"href\"), success: function(src) { link.parents(\"dt\").next(\"dd\").replaceWith(src).next(\"dt\") .find(\"a\").loadContentInOrder(); } }); }; Monday, March 23, 2009
    25. Isolate Bottlenecks Monday, March 23, 2009
    26. Monday, March 23, 2009
    27. JSON Monday, March 23, 2009
    28. { \"db\": { \"id\": 13, \"name\": \"Tyler Hansbrough\", \"occupation\": \"UNC Basketball Player\", \"bagfactor\": 1.3, \"avatar_id\": 61 } } Monday, March 23, 2009
    29. class DbsController < ApplicationController def show @db = Db.find(params[:id]) respond_to do |format| format.html format.js { ... } format.json do render :json => { :bagfactor => @db.bagfactor } end end end end Monday, March 23, 2009
    30. $(\"img.spinner:first\").each(function() { $(this).loadBagfactor(); }); jQuery.fn.loadBagfactor = function() { img = this; $.ajax({url: this.parents(\"dd\").prev(\"dt\") .find(\"a\").attr(\"href\"), data: { format: \"json\" }, dataType: \"json\", success: function(db) { img.replaceWith(db.bagfactor); $(\"img.spinner:first\").loadBagfactor(); } }); }; Monday, March 23, 2009
    31. The best solution? Monday, March 23, 2009
    32. The worst solution? Monday, March 23, 2009
    33. New Problem Monday, March 23, 2009
    34. PYTHONISTAS It's my way or f--k you. Monday, March 23, 2009
    35. Remove Blocking Operations Monday, March 23, 2009
    36. The Usual Way •Hidden iFrame •Second form w/ iFrame as target •Server sends back JS to update page Monday, March 23, 2009
    37. Something Sorta Nuts Monday, March 23, 2009
    38. $(\"a#ajax-uploads\").click(function() { $(\"input[type=file]\").replaceWith( '<iframe src=\"/avatars/new\"></iframe>'); return false; }); Monday, March 23, 2009
    39. <% form_for @avatar, :html => { :multipart => true } do |f| %> <%= f.file_field :image %> <% end %> <% javascript_tag do %> $(\"input\").change(function() { $(this).hide().after('<%= image_tag \"spinner.gif\" %>') .parents('form').submit(); }); <% end %> Monday, March 23, 2009
    40. <%= image_tag @avatar.image.url(:thumb) %> <% javascript_tag do %> $(\"form\", top.document).append( '<%= hidden_field_tag \"db[avatar_id]\", @avatar.id %>'); <% end %> Monday, March 23, 2009
    41. Cool? Lame? Monday, March 23, 2009
    42. Conclusion Monday, March 23, 2009
    43. Consider perceived performance Monday, March 23, 2009
    44. Write your own JS Monday, March 23, 2009
    45. Thank You http://speakerrate.com/events/64 Monday, March 23, 2009
    46. Questions? Monday, March 23, 2009
    SlideShare Zeitgeist 2009

    + David EisingerDavid Eisinger Nominate

    custom

    693 views, 2 favs, 1 embeds more stats

    As Phil Karlton said, “there are only two hard th more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 693
      • 691 on SlideShare
      • 2 from embeds
    • Comments 0
    • Favorites 2
    • Downloads 2
    Most viewed embeds
    • 2 views on http://spkr8.local

    more

    All embeds
    • 2 views on http://spkr8.local

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories