CS193H: High Performance Web Sites Lecture 25: 2008 State of Performance Steve Souders Google...

Post on 26-Mar-2015

223 views 2 download

Tags:

Transcript of CS193H: High Performance Web Sites Lecture 25: 2008 State of Performance Steve Souders Google...

CS193H:High Performance Web Sites

Lecture 25:

2008 State of PerformanceSteve Souders

Googlesouders@cs.stanford.edu

announcementsFinal exam:• not inclusive – only includes material since midterm• about the same size as midterm• 2 hour time limit (but should only take 1 hour)• two time slots, pick the one you want:

Tues Dec 9, 12:15-2:15 – Gates B03 Fri Dec 12, 12:15-2:15 – Gates B01

State of Performance

Web 100Future of PerformanceSteve's Little Red Book

Web 100the data was very noisyissues due to unclear assignment and variability of test conditions:• HTML, JS, CSS compressed or uncompressed?• logged in or not logged in?• web site content changes• ads• for timing, variability of testers' setup

Web 100 sites100 160 web sites from Alexa Top 500

4shared.comabout.comaim.comalibaba.comalice.itallegro.plamazon.comanonym.toanswers.comaol.comapple.comask.comatt.comatt.netbadoo.combaidu.combankofamerica.combbc.co.ukbebo.combestbuy.comblogger.combreak.combrothersoft.comcareerbuilder.comchase.comcircuitcity.comcnn.comcomcast.netconduit.comcraigslist.orgdailymotion.comdell.com

deviantart.comdigg.comdisney.go.comdownload.comeasy-share.comeasybizchina.comebay.comen.netlog.comexpedia.comfacebook.comfastclick.comfilefactory.comflickr.comfoxsports.comgamefaqs.comgamespot.comgeocities.comglobo.comgo.comgoogle.comgooglesyndication.comhi5.comhp.comhulu.comicq.comideo.comig.com.brign.comimageshack.usimagevenue.comimdb.comimeem.com

indiatimes.comisohunt.comjayisgames.comlast.fmlatimes.comlinkbucks.comlinkedin.comlive.comlivejournal.commapquest.commediafire.commetrolyrics.commicrosoft.comminiclip.commininova.orgmixi.jpmlb.commonster.commozilla.commsn.commultiply.commyspace.comnba.comnbcolympics.comndtv.comneopets.comnetflix.comnewegg.comnewgrounds.comnfl.comnoaa.govnytimes.com

onemanga.comonet.plopendns.comorange.frorbitz.compartypoker.compeople.compeople.comperfspot.compogo.comqq.comquizrocket.comrediff.comreference.comsaatchi-gallery.co.uksfgate.comshopping.comskype.comskyrock.comslickdeals.netslide.comsmileycentral.comsoftonic.comsonico.comsourceforge.netsportsillustrated.cnn.comsportsline.comsweetim.comtagged.comtarget.comtelegraph.co.ukterra.com.br

thefreedictionary.comthepiratebay.orgtheplanet.comtinypic.comtribalfusion.comtv.comtypepad.comunivision.comuol.com.brups.comusps.comveoh.comverizon.netverizonwireless.comvmn.netwachovia.comwalmart.comwamu.comwashingtonpost.comweather.comwikia.comwikipedia.orgworldofwarcraft.comwowarmory.comwunderground.comxanga.comyahoo.comyelp.comyoutube.comzedo.comziddu.comzshare.net

Web 100 statsaverage size: 466Kaverage # of requests: 70average response time: 4.75 seconds

average backend: 337 msaverage frontend: 4431 msaverage ratio: 11%

average YSlow grade: 54corr(size, time) = 0.43corr(requests, time) = 0.52corr(yslow, time) = -0.43

Future of Performancedevelopers think "Web 2.0"visibility into the browserdeferred JavaScriptprefetch servicesspeed as a distinguishing featurestandards, benchmarksuser-driven transparencyperformance off the desktop

web devs think "Web 2.0"the days of Web 1.0 are fading away...but web developers still think in terms of the page reloading on every user actionWeb 2.0 pages may persist for hoursneed to evolve the way we program to keep our eyes on the long run, for example:• watch for memory leaks• # of DOM elements• optimize JS and CSS for ongoing DHTML

visibility into the browserhard to measure the exact things we're trying to optimize• HTML parsing• CSS parsing• JS parsing and execution (as the page loads)• DOM manipulation

web page profiler (concept)paint events

memory

CPU

JavaScript CSS

deferred JavaScripttools to automatically split (huge) Web 2.0 JavaScript payload into smaller initial module and larger later module(s)a la Doloto

http://research.microsoft.com/research/pubs/view.aspx?tr_id=1402

ability to specify defer using HTML<script defer src=...><script afteronload src=...>

prefetch servicesensure resources are cached for sites I always visitbrowser support• user-specified and auto-detected "favorite sites"• two caches: transient and persistent• persistent cache isn't purged or flushed by default

clientside support• e.g., Gears

prefetch standard protocol• /prefetch.xml – manifest list

speed as a featuresites use speed as a competitive advantage• remember Yahoo! and Google search?• Facebook vulnerability?

aggregators & vendors prioritize based on speed• Google incorporates load time into Adwords Quality

Score• http://adwords.blogspot.com/2008/03/landing-page-load-

time-will-soon-be.html

performance standardstest suites for web sitesbenchmarks for browsersstandards for "response time"web page digest

archive of all relevant information about a page load

shared instrumentation and reporting

user-driven transparencyInternet community contributes to performance data warehouseexamples:• UA Profiler – http://stevesouders.com/ua/• PBWiki JavaScript Library loading speed• Cloud Four Mobile Connection Test

off the desktopproliferation of web clients besides desktop browsers...requires investigation and evangelism of performance best practices for these platforms• mobile, PDA• auto, mass transit• airplane• 3rd world

Steve's Little Red Bookthink like a scientistquestion assumptionsmore data is not always better (and it's frequently worse)don't plan too far aheadthere's a difference between bad decisions and bad outcomesstrive for perfection, but don't rely on itif you're not failing, you're not pushing hard enoughTRUST YOUR GUT!