Yahoo! vs. Yahoo! Three Large-Scale Mainstream DHTML Implementations Nate Koechley

Slides:



Advertisements
Similar presentations
Copyright © 2012 Certification Partners, LLC -- All Rights Reserved Lesson 4: Web Browsing.
Advertisements

Introduction to JavaScript Module 1 Client Side JS Programming M-GO Sponsored By
Web Applications Development Using Coldbox Platform Eddie Johnston.
Ellucian Mobile: Don’t text and drive, kids!
ProJAX An AJAX Framework for Progress Tom Bascom President Greenfield Technologies
February 11, 2007 Can Ajax be OS for the Browser? Kevin Hakman Co-Founder General Interface Ajax Toolkit Director, Developer Evangelism TIBCO Software.
© 2007 IBM Corporation IBM Emerging Technologies Enabling an Accessible Web 2.0 Becky Gibson Web Accessibility Architect.
AJAX & By – Anupama Sharma. Defining Ajax Ajax isn’t a technology. It’s really several technologies, each flourishing in its own right, coming together.
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
ITWS-2210 / CSCI Logistics Format – Class w/ mini projects (graded on class participation) – Labs (individual projects, graded on completion in.
It’s always better live. MSDN Events Developing ASP.NET AJAX Controls with Silverlight.
Development of mobile applications using PhoneGap and HTML 5
A closer look Dynamic Webpages Jessica Meyerson March 1, 2011.
ITM352 Javascript and Dynamic Web Pages: Client Side Processing.
Web Design Basic Concepts.
JavaScript & Metaperformance Douglas Crockford Yahoo! Inc.
EWD VistA Update 2010 Rob Tweed M/Gateway Developments Ltd.
Introduction to AJAX AJAX Keywords: JavaScript and XML
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
DNN Performance & Scalability Planning, Evaluating & Improving : Part 2.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Developing Better PhoneGap Apps Session 608 / DevLearn 2013 Daniel Pfeiffer Lead Developer / Float Mobile Learning.
Unit 1 – Web Concepts Instructor: Brent Presley. ASSIGNMENT Read Chapter 1 Complete lab 1 – Installing Portable Apps.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
The Internet and the World Wide Web. The Internet A Network is a collection of computers and devices that are connected together. The Internet is a worldwide.
Nate Koechley – Yahoo! vs. Yahoo!: Case Studies Nate Koechley Senior Engineer & Designer, Yahoo! User Interface (YUI) Library Team.
ITCS 6010 SALT. Speech Application Language Tags (SALT) Speech interface markup language Extension of HTML and other markup languages Adds speech and.
HTML history, Tags, Element. HTML: HyperText Markup Language Hello World Welcome to the world!
AJAX and Atlas in ASP.NET 2.0 William J. Steele MSDN Developer Evangelist Microsoft Corporation
Introduction to HTML Tutorial 1 eXtensible Markup Language (XML)
Weekend MS CS Program Internet and Web Technologies COT 5930 Web Project Development - Ajax Dr. Roy Levow, Associate Chair & Professor
1 Yahoo! User Interface Library Nate Oracle User Experience April 17th, 2006.
Random Logic l Forum.NET l AJAX Behind the buzz word Forum.NET ● January 23, 2006.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
AfterCollege Self-Service Scrape Configuration & Posting Utility Kai Hu Haiyan Wu May 14, Harney 235.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
A Lap Around Windows Presentation Foundation. Why hasn’t UX taken off in software? It’s Difficult! Animation 2D 3D Documents Styled Controls Video Windows.
INTRODUCTION TO WEB APPLICATION Chapter 1. In this chapter, you will learn about:  The evolution of the Internet  The beginning of the World Wide Web,
World Wide Web “WWW”, "Web" or "W3". World Wide Web “WWW”, "Web" or "W3"
Quick overview of ASP.NET Ajax Ajax deep-dive Cover some key real-world problems Discuss solutions, patterns, opportunities Lots of demos And more of.
REAL WORLD AJAX MARCH TIBCO USER CONFERENCE / 2004 Enterprise Rich Internet Applications with AJAX Real World Case Studies with TIBCO General Interface™
Putting Performance Best Practices Together to Create the Perfect SPA Chris Love2Dev.com.
INNOV-7: Building a Richer UI for the Browser Chris Skeldon Senior Solution Consultant.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
ASP.NET (Active Server Page) SNU OOPSLA Lab. October 2005.
REST By: Vishwanath Vineet.
Chapter 1 Introduction to HTML, XHTML, and CSS HTML5 & CSS 7 th Edition.
AJAX and REST. Slide 2 What is AJAX? It’s an acronym for Asynchronous JavaScript and XML Although requests need not be asynchronous It’s not really a.
IE Developer Tools Jonathan Seitel Program Manager.
1 Yahoo! vs. Yahoo! Yahoo! Case Studies Across the Doc—App Spectrum Nate Koechley: The Ajax Experience.
1 Y! v. Y! Yahoo! Case Studies Across the Page—App Spectrum, One Size Does Not Fit All Nate Koechley 2006, London – June 16 th, 2006
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
JQUERY AND AJAX
Flux & React Web Application Development Mark Repka, Rich McNeary, Steve Mueller.
1 MIT 5316 Web-Based Computing Lecture 1. 2 Welcome Introduction Syllabus.
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
INTRODUCING HYBRID APP KAU with MICT PARK IT COMPANIES Supported by KOICA
IF STARBUCKS USED INSTART LOGIC, THEY WOULD HAVE A FASTER RESPONSIVE WEBSITE BY PETER BLUM.
Enhance Your Page Load Speed And Improve Traffic.
AJAX.
AJAX.
Prepared for Md. Zakir Hossain Lecturer, CSE, DUET Prepared by Miton Chandra Datta
A second look at JavaScript
Modern web applications
Modern web applications
Introduction to World Wide Web
Running C# in the browser
Yale Digital Conference 2019
Presentation transcript:

Yahoo! vs. Yahoo! Three Large-Scale Mainstream DHTML Implementations Nate Koechley yuiblog.com yuiblog.com developer.yahoo.com/yui nate.koechley.com/blog developer.yahoo.com/yui nate.koechley.com/blog

a short historical story…

1994

1995

Source: Comscore, Feb. 2006

mm users /month 5.2billion hits /month Source: Comscore, Feb. 2006

Video:

so what?

It is immensely telling that the new Yahoo! homepage is a DHTML and Ajax homepage.

why?

because of these facts?

It’s noteworthy because: 1.“Browser are the most hostile software engineering environment possible” (Douglas Crockford)

It’s noteworthy because: 1.“Browser are the most hostile software engineering environment possible” (Douglas Crockford) 2.Massive edge-cases and unknowns

It’s noteworthy because: 1.“Browser are the most hostile software engineering environment possible” (Douglas Crockford) 2.Massive edge-cases and unknowns 3.From content distribution to true software development

It’s noteworthy because: 1.“Browser are the most hostile software engineering environment possible” (Douglas Crockford) 2.Massive edge-cases and unknowns 3.From content distribution to true software development 4.From Implementation Models to Mental Models

from implementation model to mental model

“Every application must have an inherent amount of irreducible complexity. The only question is who will have to deal with it.” ----Larry Tesler’s Law of Conservation of Complexity

Which is better? a) 100 milliseconds? b) 27 ½ years?

“getting it right the second time” --matt sweeney

Three Case Studies

From Scratch Massive Scale –5.2 billion views/month –188 million unique users/month DHMTL/Ajax Implementation (all data from comScore)

Video:

From Scratch –With legacy constraints Massive Scale –50 million unique users –Open content platform Major DHTML/Ajax Implementation

Video: Video:

Legacy –For IE via Oddpost in 1999 Massive Scale –World’s largest provider ~ 275MM –Available in 21+ languages Preeminent DHTML/Ajax Application

Video:

Common Goals (Technical) 1.Interactivity

1) Interactivity Simple Efficient Powerful Rich Familiar Delightful

“It’s not about what you can do, but how quickly” -- Steve Carlson, Lead Web Developer, My Yahoo!

Common Goals (Technical) 1.Interactivity 2.Performance

“Law 3: Savings in time feel like simplicity.” -- John Maeda The Laws of Simplicity, MIT Press

2) Performance Time ‘til paint Time ‘til onLoad Speed over the wire Speed of development Resource footprint

Common Goals (Technical) 1.Interactivity 2.Performance 3.Soundness

3) Soundness True to our beliefs Stable and foundational Maintainable Testable, tunable

Some Common Approaches Yes Compression YesNo Obfuscation Yes Minimization Yes Keyboard NoYes Font-size Responsive Yes CSS Sprites QuirksStrict Render Mode NoneHTML 4.01 Strict Doctype

to Applications from Documents & Pages

The Page—Application Spectrum Historically Web Shallow Interaction Simple Idioms Content-Focused Markup + Skin Sequential Passive Historically Desktop Deep Interaction Sophisticated Idioms Process-Focused DOM + Ajax Contained Active

ApplicationPage

Looking Across the Spectrum 1.Tracking Events 2.Memory Management 3.Delivering JS and CSS 4.Data Format 5.Pagination 6.Browser Support

Looking Across the Spectrum 1.Tracking Events 2.Memory Management 3.Delivering JS and CSS 4.Data Format 5.Browser Support

From: Page-Granular To: Event-Granular

Use an Event Utility: No JS in markup attribute space Many great utilities –Dojo –YUI Event Utility –many more… Watch out for memory leaks, really

Event Attachment Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts

What happens as your app gets more complex?

more events x more objects

Feeling lucky?

Tracking Events: The Challenge How can we minimize the number of objects in play? How can we minimize the number of events attached and tracked?

Example: Standard Attachment Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts Obj +evnts

Example: Single Delegating Event Obj Event

Minimize object and event counts: 1.Capture the element high in the DOM tree: document.onclick 2.Then determine which element getTarget() 3.Then add just-in-time logic Example:

Tracking Events: Limited objects & simple handlers Attachment Event Delegation Plan Event Model API divorced from UI Many objects & multiple handlers Event Delegation PlanApplicationPage

Looking Across the Spectrum 1.Tracking Events 2.Memory Management 3.Delivering JS and CSS 4.Data Format 5.Browser Support

Memory Management Things can get out of hand. Things will get out of hand. Goals: 1) Don’t leak memory 2) Keep overall footprint minimal 3) Always-responsive, stable interface

The Key Approach 1.DOM Destruction Thoroughly Unhook and Remove Handlers and References YUI Event provides lots for free

Two Approaches 1.DOM Preservation 2.DOM Recycling

Memory Management Tip (1) Monitor Usage Drip is a great tool on PC –MSDN: Understanding and Solving Internet Explorer Leak PatternsUnderstanding and Solving Internet Explorer Leak Patterns – itle=Main_Pagehttp://outofhanwell.com/ieleak/index.php?t itle=Main_Page

Memory Management Tip (2) Monitor Various Usage Cases 1. Extreme object counts 2. Long interactions 3. Extensive navigation

Memory Management Preservation (based on use case) Destruction Destruction, but also... Recycling (of iframes)ApplicationPage

Looking Across the Spectrum 1.Tracking Events 2.Memory Management 3.Delivering JS and CSS 4.Data Format 5.Browser Support

General Best Practice: Single large file is fastest Minimize HTTP requests – erformance-research-part-1/ erformance-research-part-1/ CSS near top JS near

Another Approach (1) Many small files at once Enables –team development –atomic testing –partial caching A build process can clean up and concatenate for production

Another Approach (2) Many small files on demand Enables –easier tuning in response to real-world usage –Faster overall time, though sometimes slower individual time (bait and switch)

Another Approach (3) Inline in the Caching doesn’t always work. –In particular: browser’s home page. DNS lookups are costly Extra domains are costly

Yahoo! Confidential Nate Koechley – 71 Delivering CSS and JS: Many smaller files, on demand. Some inline. Every feature not used every time. Content is key. Über files of interface JS/CSS. Pay once. Then, data and objects on demand Single file (anti-example) Functionality is key. Highly interconnected.ApplicationPage

Looking Across the Spectrum 1.Tracking Events 2.Memory Management 3.Delivering JS and CSS 4.Data Format 5.Browser Support

General Best Practice (1) Use JSON for data interchange –“The fat-free alternative to XML” –Natively understood. No parsing or crawling. –It’s Ajax not AJAX –Tools in every known programming language

General Best Practice (2) Track and create “state” on the server. My Y!: –Pass generated HTML in set JSON wrapper –Set JSON structure includes content, metadata, and assets

Other Notes: Who’s CPU to heat up is an important architectural question. Finding: Parsing XML degrades performance greater-than-linearly as XML size increases.

Yahoo! Confidential Nate Koechley – 76 Data Format: “JSON rocks” JSON, DOM strings “Some JSON, and more soon” “Be sure to recognize strengths of client and server”ApplicationPage

Disclaimer: JSON is great, but an intimate understanding of your application is best.

Looking Across the Spectrum 1.Tracking Events 2.Memory Management 3.Delivering JS and CSS 4.Data Format 5.Browser Support

Binary Browser Support Do I need to support Browser Foo on this project? Same as saying: Those users aren’t welcome.

Graded Browser Support 1.“Support” does not mean “Same”

same isn’t important “Expecting identical experiences fails to embrace or acknowledge the heterogeneous essence of the Web.”

Graded Browser Support 2. Grades of support provide an [appropriate] experience for all.

The Web is about Availability A graded approach welcomes everyone while bringing sanity to development and testing.

Browsers: The Dirty Truth The Web is the most hostile software engineering environment imaginable. – Douglas Crockford

C-grade - core support, ~ 2% A-grade - advanced support, ~ 96% X-grade - the X-Factor, ~ 2% Three Grades of Browser Support

Yahoo! Confidential Nate Koechley – 90 Browser Support: GBS A-grade Developed with Web Standards GBS A-grade Developed with Web Standards IE and FF Developed in IE, then built IE-emulation layer.ApplicationPage

Cheat Sheet: 1.Stay true to your beliefs 2.Have an event plan 3.Monitor memory and CPU 4.Minimize HTTP requests 5.Create state on server 6.Have a sane browser support plan

Bad decisions are tomorrow’s constraints.

Good decisions are tomorrow’s opportunities.

Thank you.

We’re Hiring! Josie Aguada: Usual suspects: JavaScript, PHP, CSS, HTML, ActionScript…

Thank you Photo Credits: – – –

Questions?

i don’t know.

Namespaces History –JS is load-and-go; text is eval’d; Implied global variables were a nicety Bad because of unreliability and insecurity –Trouble when we mashup, have many devs, and programs get large Many global variables is bad Ideally, only a single global per app|lib|widget –An object which contains all others Speed unaffected; self documentation; reliable Shorten locally if you want.

Single Page vs. Multiple Page What’s the sweet spot?