Yahoo! vs. Yahoo!: Case Studies
Yahoo! vs. Yahoo!: Case Studies
Yahoo! vs. Yahoo!: Case Studies
: Case Studies
Web Builder 2.0 Las Vegas
Nate Koechley
Senior Engineer & Designer,
Yahoo! User Interface (YUI) Library Team
Platform Engineering Group
Yahoo! Inc.
Slides
http://nate.koechley.com/talks/2006/12/webbuilder/
Contact
http://yuiblog.com
[email protected]
http://developer.yahoo.com/yui
Nate Koechley – [email protected]
My Perspective
http://alex.dojotoolkit.org/
DHTML_universe.pdf
1994
1994
1995
1994
1995
1997
1994
1995
1997
2000
1994
1995
1997
2000
2002
1994
1995
1997
2000
2002
2004
1994
1995
1997
2000
2002
2004
Today per month:
188m users
Source: Comscore,
Nate Koechley Feb. 2006
– [email protected]
5.2 billion hits
Video:
Nate Koechley http://nate.koechley.com/talks/2006/12/webbuilder/Yahoo-vs-Yahoo/fp_2.avi
– [email protected]
It is immensely telling that
the new Yahoo!
homepage is a DHTML
and Ajax homepage.
History
–From scratch
Massive Scale
–5.2 billion views / month
–188 million unique users / month
DHMTL and Ajax Implementation
History
–From scratch
–Agile design and development project
Massive Scale
–30 million unique users
–2 billion photos
Major DHTML and Ajax Implementation
Video:
Nate Koechley http://nate.koechley.com/talks/2006/12/webbuilder/Yahoo-vs-Yahoo/photos3_2.avi
– [email protected]
Case Study #3
mail.yahoo.com
History
–Beta release about 1.5 years ago
–Legacy-ish! (was Oddpost.com since 1999)
Massive Scale
–World’s largest email provider ~257MM
–Available in 21 languages
Preeminent DHTML and Ajax
Application
Nate Koechley – [email protected]
Video:
Nate Koechley http://nate.koechley.com/talks/2006/12/webbuilder/Yahoo-vs-Yahoo/mail_1.avi
– [email protected]
(Don’t
(Don’t worry
worry –– not
not aa product
product pitch)
pitch)
1) Performance
time-to-paint
time-to-onLoad
speed on the wire
speed of development
memory & CPU footprint
1) Performance
2) Interactivity
1) Performance
2) Interactivity
3) Make Good Choices
Absolute Pos No No No
Obfuscation No No Yes
Compression Yes Yes Yes
Nate Koechley – [email protected]
from Documents
& Pages
to Applications
Nate Koechley – [email protected]
The Page—Application Spectrum
1. Tracking Events
2. Memory Management
3. Delivering JS and CSS
4. Data Format
5. Pagination
6. Browser Support
1. Tracking Events
2. Memory Management
3. Delivering JS and CSS
4. Data Format
5. Pagination
6. Browser Support
Event
Obj Obj Obj Obj
Event
Obj Obj Obj Obj
function clickDelegate(e){
// get the target
var origin = YUI.Event.getTarget(e, false);
// delegate “just in time”
if(YUI.Dom.hasClass(origin, 'child'))
alert(origin.innerHTML + ' was clicked.');
}
<div id="parent">
<div class="child">Foo</div>
<div class="child">Bar</div>
</div>
http://yuiblog.com/sandbox/yui/v0114/examples/event/delegation.php
Nate Koechley – [email protected]
Tracking Events:
Page Application
Nate Koechley – [email protected]
Looking Across the Spectrum
1. Tracking Events
2. Memory Management
3. Delivering JS and CSS
4. Data Format
5. Pagination
6. Browser Support
1. DOM Destruction
2. DOM Conservation
3. DOM Recycling
• Destruction
Page Application
Nate Koechley – [email protected]
Memory Management Tip:
http://outofhanwell.com/ieleak/index.php?title=Main_Page
MSDN: Understanding and Solving Internet Explorer Leak Patterns
1. Tracking Events
2. Memory Management
3. Delivering JS and CSS
4. Data Format
5. Pagination
6. Browser Support
Page Application
Nate Koechley – [email protected]
Looking Across the Spectrum
1. Tracking Events
2. Memory Management
3. Delivering JS and CSS
4. Data Format
5. Pagination
6. Browser Support
http://www.json.org
–Tools in every known programming
language
“JSON rocks”
Page Application
Nate Koechley – [email protected]
Disclaimer:
Disclaimer:
JSON
JSON is
is great,
great, but
but an
an intimate
intimate understanding
understanding of
of
your
your application
application is
is best.
best.
1. Tracking Events
2. Memory Management
3. Delivering JS and CSS
4. Data Format
5. Pagination
6. Browser Support
In all cases:
– Know your DOM.
– Know your footprint.
– Know your users.
• Heavy objects
• Pagination with Ajax (new group in memory)
• Light objects
• Endless-scrolling (and clever caching)
Page Application
Nate Koechley – [email protected]
Looking Across the Spectrum
1. Tracking Events
2. Memory Management
3. Delivering JS and CSS
4. Data Format
5. Pagination
6. Browser Support
Same as saying:
Those users aren’t welcome.
• GBS A-grade
• Developed in Gecko
• GBS A-grade
• Developed in Gecko
• IE and FF
• Developed in IE, then built IE-emulation layer.
Page Application
Nate Koechley – [email protected]
Bad
Bad decisions
decisions are
are
tomorrow’s
tomorrow’s constraints.
constraints.
Good
Good decisions
decisions are
are tomorrow’s
tomorrow’s
opportunities.
opportunities.
[email protected]
http://nate.koechley.com/talks
[email protected]
http://nate.koechley.com/talks
[email protected]
http://nate.koechley.com/talks
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.
http://yuiblog.com/blog/2006/06/01/global-domination/
[email protected]
http://nate.koechley.com/talks
http://developer.yahoo.com/yui
http://yuiblog.com
http://nate.koechley.com/blog
Photo Credits:
– http://www.flickr.com/photos/jacqueline-w/56107224/
– http://www.flickr.com/photos/grimreaperwithalawnmower/191890428/
– http://www.flickr.com/photos/jasonmichael/4126695/