Velocity 2011
Table of Contents
- Tuesday, June 14th
- 9:00am Performance Tools
- WebPageTest
- Blaze.io
- ShowSlow
- Local installation for providing the correct data to management
- Configuration is just limited to several database configuration elements
- Enable local instances
- WebPageTest is now pushing results to ShowSlow
- This isn't monitoring, it's best practices
- Integration with Boomerang
- PageSpeed is much easier with the I/O updates to the Page Speed API
- dynatrace
- 11:00am Decisions in the Face of Uncertainty
- 1:45pm Performance Enhancing Programming with NodeJS Tim Caswell (Creationix)
- 3:45pm Mobile Web & HTML5 Performance Optimization
- Root causes for mobile web development issues
- What can't be used
- Must use
- Debugging
- How to test different networks
- Example: united.com
- TODO Tasks
- Use mobile tags and viewport.
- Change the design process to focus on the light and use case scenarios.
- Use server-side detection
- Don't redirect
- Be simple and use only a simple semantic DOM
- Don't use a class on the body
- No empty hrefs (including #)
- Only semantic images
- Compress all images
- data URI core images
- Icons: Canvas + toDataURL()
- Emoji characters on iOS
- Leave a feature without the nice design
- Defer code after onload
- Don't parse frameworks
- Remove address bar onload
- Defer content and code
- Parsing JavaScript takes time
- Use the W3C Selectors API
- Application Cache
- Offline storage
- No external CSS, JavaScript
- Touch, no click
- Ajax
- Use onhashchange for history management + pushState for SEO
- Use HTML > JSON > XML
- html5 server-sent events
- Web Sockets
- Context and user decision
- Network Information API
- window.devicePixelRatio
- Don't use timers with more than 1s
- 7:00pm Plenary Room: Mission City Ballroom Ignite Velocity
- 9:00am Performance Tools
- Wednesday, June 15th
- 8:30am - 12:00pm Demos and Keynotes
- 1:00pm CSS3 & HTML5 - Beyond the Hype!
- 1:50pm Writing Fast Client-Side Code: Lessons Learned from SproutCore
- How do you combine expressiveness with performance
- When looking at full page applications there are requirements
- JS is cheaper than DOM
- Events can't coalesce; need to use flagging
- Materialize objects when used
- Follow speed guidelines
- Example
- SproutCore Implementation
- Keep the intermediate state in JavaScript not DOM
- Prefer Coalescing Operations
- SproutCore: use a data object for instantiation
- SproutCore 2.0
- 2:40pm Oh, To Be Single Again - Building a Single Codebase in a Client-server World
- 4:55pm WebPagetest Update
- 4:05pm Know Your Engines: How to Make Your JavaScript Fast
- 4:55pm WebPageTest updates
- 5:20pm Web Site Acceleration with Page Speed Technologies
- Modern vs. older
- Combine external resources
- Sharded domains
- JavaScript loading of JavaScript
- Doubleclick reduced 1 redirect and decreased
- App Cache saved 3s
- Mobile RTT
- Touch vs. Click = 300ms overhead saved
- Reommendations: use Application Cache
- Reflows
- Avoid long-running scripts
- Page Speed for Chrome added three new rules
- 5:45pm modpagespeed
- Thursday, June 16th
- 8:30am - 12:00pm Demos and Keynotes
- 11:00am Browsers - Chrome
- 11:25am Browsers - Firefox
- 1:50am Instrumenting the real-time web
- 2:40pm Performance Guides for Canvas
- 4:05pm Metrics-driven Engineering at Etsy
- Why talk about metrics
- Metrics are part of the product
- …but make it easy
- Ganglia and Graphite
- Need to buffer logs to turn them into
- accesslogs
- statsd
- logsterd
- Deployments and Correlations
- Determine alerting
- 48 dashboards by 32 engineers
- Low MTTD but don't stop failures
- Log collection
- QA Engineers
- Working with Splunk can be painful
- Deployment
- 4:55pm Hacking Google Analytics to Track Arbitrary Data Artur Bergman (Wikia)
- 5:20pm The Impact of Ads on Performance and Improving Perceived Performance
- Summary
- Tasks
- Review concatention policy based on revised Page Speed rules
- Why a web page isn't the same as mobile
- TODO Build a toolkit
- Need build tools
- Create strategic tooling for mobile performance analysis
- Evaluate m.instagrub.com
- Interal WebPageTest
- Example Blaze.io setup
- Write expanded code so the JavaScript artifacts can be selectively removed from download queue
- Internal ShowSlow setup
- Prototype AngularJS
- Consider a weekly performance review team for 6m
- Push the idea of external monitoring of performance beyond Gomez
- Prototype AngularJS
- Dynatrace examples
- Prototype Chef
- Training Session: Performance monitoring, analysis, and deep dive
- TODO WebDev Triage: Any front-facing action for the site (features, FlexPub, ads)
- Dynatrace JavaScript/AJAX report includes contributor
- Workflow for performance review
- Statistics
- pcap and httptrace
- Install node-bench
- Create a node
- JavaScript API design in Node and CoffeeScript
- Internal resource allocation
- Internal projects to get people up to speed
- Perform the base mobile standard for the home page
- Know trade-off between design, feature, analytics, and performance
- Additional cost for removing jQuery-specific features for Selectors API
- Review mini-Frameworks for mobile (Zepto)
- Using application cache complicate updates needs vetting with CM
- Alternatively look at using localStorage
- Server can reply with everything inline + cookie
- Prototype querySelectorAll
- TODO Implement a Backbone (MVC) prototype
- TODO Implement Knockout (MVVM)
- Define the policy on data objects for constructors
- Perform a sumamry of the types of object construction and APIs
- Push client templating solution
- Push a script loader
- Review concatantion strategy
- Changes to the Recommended performance approach
- Inherency: when to make changes to the performance approach
- Test offline support for mobile app
- WebPageTest without ads or JavaScript
- Web + Mobile Performance Tools
- Console updates in Firebug and Chrome
- Will double-buffering improve SEO rankings
Tuesday, June 14th
9:00am Performance Tools
Steve Souders (Google), Patrick Meenan (Google), Alois Reitbauer (dynatrace Software), Sergey Chernyshev (truTV)
http://velocityconf.com/velocity2011/public/schedule/detail/19771
WebPageTest
WebPagetest Basic Results Filmstrip Test History Filmstrip Comparison Filmstrip Labels Video Comparison Dynatrace Result tcpdump WebPagetest Presentations Google Booth Presentations
Blocking content
Block content…take this back to a management team to illustrate the benefits of applying resources to the effort.
The tradeoffs required are often based around
WebPageTest can target specific content loads with tags
Comparing different runs by relabeling the params for the runs
Start downloading a Dynatrace if CPU use is excessive
Can run the debugging offline.
This is an underused feature.
The standard is that Dynatrace should be
Capture network packet trace (tcpdump)
If there is a question if something really took that long to load.
TODO A session tomorrow
TODO In Google Booth at 3:30PM tomorrow
Blaze.io
Booth will show other agents
Poll a WebPageTest instance for work. Perform the render. Upload the results.
Only runs over WiFi given the cost of 3G
Only supports a subset of WebPageTest
Hosting support for a Mobitest agent is at 5:30
UI Web View issues from
Caching being handles
ShowSlow
Sergey Chernyshev (truTV)
Local installation for providing the correct data to management
Configuration is just limited to several database configuration elements
Enable local instances
WebPageTest is now pushing results to ShowSlow
This isn't monitoring, it's best practices
This also has some Selenium integration.
Integration with Boomerang
PageSpeed is much easier with the I/O updates to the Page Speed API
dynatrace
http://ajax.dynatrace.com/ajax/en/
Most useful for profiling JavaScript applications.
Lighting demo should show advanced features
Various features are expanded for analysis, tips, etc.
Many new features for tracing performance
speedoftheweb.org compares industry page speed
Use markers to indicate when actions are performed on a page
Run comparisons are set against
This contrasts with Gomez.
HAR files can be uploaded to a ShowSlow beacon
11:00am Decisions in the Face of Uncertainty
Just Enough Statistics to be Dangerous John Rauser (Amazon)
Since most people have to work with statistics on an ongoing basis reasonable. Selected this based on the reviews last year b.
Estimation
The goal is only to only include an upper and lower bound. Don't give a single value.
The goal is to be calibrated estimators (i.e., correct 90% of the time).
Want to play a game where for each correct answer
If set too wide there's a spinner game that needs to be played.
Put off giving a single number until as late as possible
Models
- Look at cache miss rates for a CDN.
- What is packet drop for a large file.
What is the chance of k success in n success/fail trials where the chance of success for each trial is p?
Look at the consideration associated with games.
Need to provide weighting for the particular nodes.
This is a basic binary tree.
If we're evenly matched and interrupted in the middle of a match where one is ahead to
Pascals triagle: binomial coefficients: select elements in a set by position.
When on the binomial distribution at 90% confidence for the number of heads and tails I should get when flippign a fair quarter.
10,50%,2
http://www.cyclismo.org/tutorial/R/probability.html#binomial
dbinom(x, size, prob, log = FALSE) pbinom(q, size, prob, lower.tail = TRUE, log.p = FALSE) qbinom(p, size, prob, lower.tail = TRUE, log.p = FALSE) rbinom(n, size, prob)
The process one goes through is to calculate the probability.
The smaller the p-value the greater the chance that the null hypothesis isn't correct.
- Set an expected distribution based on a sample
Inference
Analytical models are approximations are used since simulation was expensive.
http://escholarship.org/uc/item/6hb3k0nz
Based on the examples noted.
rbinom(22,10,0.9) [1] 10 10 10 9 9 9 9 7 8 8 10 9 10 9 8 8 9 8 9 9 9 10
replicate(100,mean(rbinom(22,10,0.9)))
This should use a histogram:
qplot(replicate(100,mean(rbinom(22,10,0.9))))
Stats with Cats…
- Binomial:
- Exponential: number
- Gamma: site latency
Decisions
Find the mean and standard deviation of the normal distribution in our own head.
Find the percentage of space covered up to a standard deviation.
Perform some base anaysis to indicate what the curve actually looks like.
Game: maximize benefits are different than being correct (will all the money in a particular hand).
Install Sage.
- Create the normal distribution
Solve it with the derivative at 0, for x with a normal distribution .
Still need to have the fundemental elements of math but don't worry about the rest. The value function associated with the probability for a 90% confidence estimate for (an an example) the number of cards in a deck.
http://srmo.sagepub.com/view/the-sage-encyclopedia-of-social-science-research-methods/n637.xml
- How to Measure Anything
- The Cartoon Guide to Statistics
- Introductory Statistics with R
- Bayesian Data Analysis
1:45pm Performance Enhancing Programming with NodeJS Tim Caswell (Creationix)
Connected to a local node instance.
http://172.16.21.13 for the source code
telnet 172.16.21.13 1337
If you just stay in the VM it should be very fast.
Pushed lines http://172.16.21.13:3000/
pcap
httptrace –headers
If you have memory issue occurs then use dtrace to look at the process.
People really aren't using Node for deep server applications. Looks just like a toy language.
Continued pushing the ulimit to get more file support.
Breakpoint debugging
Ajax.org Cloud9
Use a Redis server as the state management.
while true; do node server.js; done
The primary audience appears to just be male.
npm is like easyinstall.
Works for the install of bench.
Not much audience participation.
node –debug
function createBox = function() { return }
http://code.google.com/p/leveldb/
$ node-waf configure build Checking for program g++ or c++ : usr/bin/g++ Checking for program cpp : /usr/bin/cpp Checking for program ar : /usr/bin/ar Checking for program ranlib : /usr/bin/ranlib Checking for g++ : ok Checking for program gcc or cc : /usr/bin/gcc Checking for gcc : ok Checking for node path : not found Checking for node prefix : ok /usr/local/Cellar/node/0.4.6 'configure' finished successfully (1.078s) Waf: Entering directory `/Users/tim/Desktop/node-leveldb/build' Waf: Leaving directory `/Users/tim/Desktop/node-leveldb/build' Traceback (most recent call last): File "/usr/local/bin/node-waf", line 16, in <module> Scripting.prepare(t, os.getcwd(), VERSION, wafdir) File "/usr/local/Cellar/node/0.4.6/bin../lib/node/wafadmin/Scripting.py", line 145, in prepare prepareimpl(t, cwd, ver, wafdir) File "usr/local/Cellar/node/0.4.6/bin../lib/node/wafadmin/Scripting.py", line 135, in prepareimpl main() File "usr/local/Cellar/node/0.4.6/bin../lib/node/wafadmin/Scripting.py", line 188, in main fun(ctx) File "usr/local/Cellar/node/0.4.6/bin../lib/node/wafadmin/Scripting.py", line 386, in build return buildimpl(bld) File "usr/local/Cellar/node/0.4.6/bin../lib/node/wafadmin/Scripting.py", line 405, in buildimpl bld.compile() File "usr/local/Cellar/node/0.4.6/bin../lib/node/wafadmin/Build.py", line 268, in compile os.chdir(self.bldnode.abspath()) OSError: [Errno 2] No such file or directory: '/Users/tim/Desktop/node-leveldb/build'
Can use the repl: use require then the API being loaded.
Use something like create… for the repl to show the information.
Useful just for the discussion. Allows talking about the system in a reasonable way.
3:45pm Mobile Web & HTML5 Performance Optimization
Maximiliano Firtman (ITMaster Professional Training)
http://velocityconf.com/velocity2011/public/schedule/detail/19976
http://www.mobilexweb.com/blog/mobile-web-html5-performance-optimization
Root causes for mobile web development issues
Slower networks
Higher latency
Slower hardware
Different browsing and context
Different behaviors
Different networks
Can be 2-4G
Significantly larger header elements
Parallel downloads different
1-6 parallel downloads.
Significant number of browsers
New HTML5 elements
Some are proxied. This can also cause transformations.
Limited documentation
No identity
No debugging tools
What can't be used
Pixels
Static
Desktop frameworks
Always connected
Unlimited power
Must use
Server side detection
Progressive enhancement
Responsive design
Best experience for context
Top model approach
Start at the top and check all timing and bytes transferred.
Debugging
Only two devices with remote debugging
- Opera Mobile with Dragonfly
- BlackBerry Browser for PlayBook
Generally have to use emulators
Use a proxy
These are used with emulators:
- Charles Proxy
- Fiddler
pcapperf, weinre, mobileperf…
Remote labs
deviceanywhere.com perfectmobile.com remote device access (noia) lab.dev (samsung)
How to test different networks
Use Charles to throttle…
Example: united.com
Blaze.io for initial review
Get the waterfall
Check multiple devices for the page load time
Check the number of DOM elements
Limit class definitions
Check the caching
Background image is 350kb not visible
TODO Tasks
This is just the recommendations set from Q2 2011.
Use mobile tags and viewport.
Change the design process to focus on the light and use case scenarios.
Use server-side detection
Don't redirect
See the case where someone goes to http://united.com/ .
Be simple and use only a simple semantic DOM
Don't use a class on the body
No empty hrefs (including #)
Only semantic images
No buttons. No images. No ornaments.
Compress all images
data URI core images
Icons: Canvas + toDataURL()
This would need to be tested.
Only on the last two version of iPhone.
Emoji characters on iOS
Might be an option for http://pukupi.com/post/1964
Leave a feature without the nice design
Noone from design was present.
Defer code after onload
Don't parse frameworks
Remove address bar onload
Defer content and code
Parsing JavaScript takes time
1ms to 100ms per 1kb.
Use the W3C Selectors API
This replaces jQuery since $ is available.
Application Cache
Set a manifest file. This ensures it's available immediately.
Offline storage
Store images in string formats.
Store CSS.
Store html elements.
Code…
This has a 2MB limit.
No external CSS, JavaScript
Images used only once should be inlined + gzip.
Touch, no click
Click event delays 300ms - 500ms.
Event: ontouchend
Ajax
Use server-side if Ajax isn't used in the request for the header elements.
Should be considered mobile friendly.
Use onhashchange for history management + pushState for SEO
Use HTML > JSON > XML
JSON.parse should be fairly fast.
html5 server-sent events
Web Sockets
Context and user decision
Need to progressively enhance. Can't assume any device will provide the same
Check the resolutions but make it fast and funtional.
Network Information API
window.devicePixelRatio
Don't use timers with more than 1s
7:00pm Plenary Room: Mission City Ballroom Ignite Velocity
Wednesday, June 15th
8:30am - 12:00pm Demos and Keynotes
http://velocityconf.com/velocity2011/public/schedule/grid/2011-06-15
Only the Crockford analysis of JS performance is of significant interest.
- Exhibit hall opens at 9:45
- t-shirt @ O'Reilly booth at 1:00PM on Wednesday.
Opening Remarks
- 12:00 t-shirt at 12:00 (1:00) @ O'Reilly booth
- 6:00 Exhibit hall
- 7:00 Dyn reception - pool
- Velocity Passport
Career Development
WebOps - term is two years old.
Hiring is more of a craftsmanship option rather than "expert" status. For most of the actual work that is completed it's based on the actual requirements for a job rather than an abstract expectation
- Educate yourself
- Discipline
- Learn and Share with Peers
- Patience
- DevOps is incomplete and requires
How does one acquire the skills or have the time to address all of the requirements unless tooling is available.
What is required to ensure operational software based on the environment?
JavaScript and Metaperformance
Can't determine degredation in the browser given the DOM: web developers may not even use the tools for inspection into the running state focusing on layout and IO.
Example: web developers will pick the approach where the trivial information about the performance (e.g., forEach, for, for in) without looking at the actual performance. Results from benchmarks for engine performance then driving the selection of programming techniques.
Causes:
- JS Engine developers need to optimize the engines against some metric.
- Web developers need to add in performance early or no time to add later.
Benchmarks don't reflect how programs actually work. There are patterns to how to write JavaScript well.
Challenge to Chrome to look at how JSLint was running in practice.
Look at Your Data
Time series charts of shallow data.
- Starry Night
- Moby Dick
20ms buckets breakdown from average data.
Testing and Monitoring Mobile Apps
Product demo (Mobile Device Perspective) for testing native Android and iOS test. Includes scripting interface, test construction, and monitoring.
Uses a built-in JavaScript engine.
API looks very minimal:
- Tap
- Swipe
- ClickKey
- StartTimer
- EndTimer
Timers just work like the event-based timers on page loads.
1:00pm CSS3 & HTML5 - Beyond the Hype!
Nicole Sullivan (Stubbornella Consulting Group)
http://velocityconf.com/velocity2011/public/schedule/detail/18244
CSS3 is finally ready
Now can stand as a viable option.
Performance vs. Design
How do you perform the trade-offs between features needed in MSIE6 and more featured browsers? How do you ensure that something is still a feature.
- No features but fast
- Remove commenting
- > in the breadcrumbs
- Gradients
- Rounded cornders
- Drop shadows
- Full featured but slow
Will your audience really check against the rendering in all browsers? That's a developer or implementation
Provide a different user experience based on browsers
But who should specify the functionality.
Selectors can degrade rapidly
Don't want to be too close to the edge of the degradation curve.
Things to review
- Selectors
- Match from right to left
- Attribute selectors are slow
- Just match on class not element.class
- Transparency
- Animation + border-raidius, gradient
- Combining elements makes them slower, requires testing
- CSS3 best features
- Replace images with CSS
- rgba(r,g,b,o)
- border-http
http://www.opera.com/docs/specs/presto211/css/selectortests/
CSS Lint
CSS linter and parser in JavaScript.
[~=foo] throws a warning.
Missing default selector for vendor prefixed throws a warning.
$ npm -g install csslint
1:50pm Writing Fast Client-Side Code: Lessons Learned from SproutCore
Yehuda Katz (Strobe, Inc.)
How do you combine expressiveness with performance
When looking at full page applications there are requirements
JS is cheaper than DOM
querySelector all may not be all faster than something like Sizzle.
Events can't coalesce; need to use flagging
If you want to combine events or if the user is performing a series of actions that don't have to be processed or completed immediately.
If this thing has happened then do this thing.
Materialize objects when used
Big data; when you get back data you don't immediately render.
Would also want to proxy something that looks like.
new Person({name: 'jason', age: 100, foo: 'bar'});
For some reasonable number of items you may want to download but not display.
Follow speed guidelines
JS is reactive and callback oriented. When this data changes then perform this action. Forces the application to immediately react to the event.
You often don't need to perform DOM changes as you get a user event.
Don't want to continue parsing the Model and then performing the action immediately. This mirrors the way that the browsers actually work with the data.
Example
var jason = new Person(); jason.setName = 'jason'; jason.setTitle = 'developer'; jason.setAddress = {street: '1234 main', state: 'WA'}
This emulates the transactional model used in databases.
jason.commit() ?
SproutCore Implementation
Creates a secondary event loop. Hooks on to the end of the primary browser event loop.
native event -> {handle event, handle event} -> sync bindings
Enforces coordination between items.
Keep the intermediate state in JavaScript not DOM
Don't try to have loops performed if only based on a single user interaction.
Prefer Coalescing Operations
If you use an event based system you don't have any other way to do anything other than to set .
Create a boolean value to indicate if something is dirty.
ArrayController.
Run loop is set as a short setTimeout
SproutCore: use a data object for instantiation
This is the same as config, options,
Compare Facebook and
SproutCore 2.0
These were largely mobile applications that drove the new features.
Minimal amount with a loader
Dependencies
Lazy load module
2:40pm Oh, To Be Single Again - Building a Single Codebase in a Client-server World
Daniel Hunt (Yahoo!)
What it means to have a combined codebase
Create JavaScript on the serverside.
History
As of 2005 there was a significant amount of content.
Launch Steps: Breaking down the structure of a page load
Skeleton HTML structure
JS download
JSON
Use loadScript() no <script>
Templating: Use Mustache
Yahoo uses Mustache.
Wdiget/Module/Plugin
- Instantiate: var myWidget = newWdiget
- Render
- Loading event and UI (RenderEvent = {parent: '', content: ''})
- getData (JSON)
- Complete event RenderEvent = {parent: '#mydiv', content: '<b>my content</b>'}
Revised structure for widgets with MVC
Controller.js: command.js, DOM.js Model.js: store.js, fetch.js View.js: render.js
Exploring Yahoo! Mail
type=mail.UI.MesageList
4:55pm WebPagetest Update
Patrick Meenan (Google) Ballroom EFGH
4:05pm Know Your Engines: How to Make Your JavaScript Fast
David Mandelin (Mozilla Corporation)
- Minimize the number of shapes provided during the implementation.
- Write type-stable SJ,
History
2006
Front-end -> AST/bytecode
Object have different shapes based on properties and prototypes.
Lots of boxing and unboxing of values with storage independent of the base execution.
2011
Front-end (Interpreter, JIT Compiler, Type-Specializing JIT Compiler)
Breaks down items into fast and slow zones. Fast provided for common operations like string concat, adding numbers, but not string + undefined.
Object Properties
IC: inline caching.
As properties are accessed the IC
- global varial
- direct property
- closure variable
Nested prototypes don't harm performance since the ICs cache the shape.
function A() { this.x = 'x' } function B() { this.x = 'y' } function C() { this.x = 'z' }
B.prototype = A;
Deeply nested closures are slow
var f = function() { var x; var g = function() { var h = function() { …
Slow
Undefined properties are always slow
DOM Access
DOM access for empty is slow.
Scripted getters
Type Specializing JIT
Tracemonkey (Firefox) Crankshaft (Chrome)
IonMonkey is an expected updated.
What is JS has a type system
Automatic Inlining
Loop Invariant Code Motion
Optimize only hot code
Tracemonkey: > 70 iterations Cranshaft: profiler specific
Garbase Collection
What requires later cleanup:
- Objects
- Arrays
- Strings
- Function objects
GC pauses execution. The essential algorithm:
- Traverse all actionalble elements
- If no other points
- Nursey (frequently called), scavenging
- Tenured (long lived), mark-and-sweep
Performance Faults
Strings
In the slow zone.
- .substring is fast (dont need to copy)
- concat is find
Arrays
Dense good. Sparse bad.
Iterations
reduce, forEach, reduce can be slow.
Arguments
Creating objects
Generally slow.
Constructors are fast.
OOP Styling
Using is the same.
Exceptions
Slow. Thow/catch is slow.
eval and with
Both violate strict.
Top 5
Avoid eval
No object in hot loops
Generates GC work
Use desne arrays
Know what causes sparse arrays.
Write type stable code
Talk to developers
4:55pm WebPageTest updates
Above the fold
4 minutes of recorded time but should be limited on the public instance. Limited to Dallas.
dynaTrace
Packet trace
Page Replay
Location in Dallas will record then measure against a recording. No backend varience.
Latency down to 0: the fastest a p
Blaze Mobitest
Deeper integration.
ShowSlow integration
Not public now. Would send trending information.
Private instances
Bulk testing
This also includes an aggregated results page.
Private instance includes EC2 agent public AMI's
Public projects
HTTP Archive.
REST API
Private is likely the best.
WPT Monitor
Watches trended information over time. Much like Gomez.
Standardized API
In progress.
5:20pm Web Site Acceleration with Page Speed Technologies
Joshua Marantz (Google), Pradnya Karbhari (Google), Michael Schneider (Google)
http://code.google.com/speed/page-speed/docs/rules_intro.html
Modern vs. older
2008
IE6, IE7.
2011
Script tags will be fetched in parallel. should reduce the need to reduce loader scripts. for core page you should just use in the
If dependencies are based on user interaction then use a loader.
Modern browsers are much better.
Combine external resources
Older browsers would serialized the requests. Round-trip by request.
Parallel resource downloads are faster. This needs to be done with real content to determine.
The factors:
- Modern or older browser
- Fragmented (200)
- Client bandwidth (number of packets)
- Initial congestion size window
Combining still makes sense for mobile. You need to test the correct approach. All of the trade-offs and measure the constraints.
If user has a lot of bandwidth the rules will change.
Sharded domains
Parallel connections across hostnames: this was a sharding approach.
JavaScript loading of JavaScript
Likely unnecessary
Doubleclick reduced 1 redirect and decreased
12% increase in click-through
RT @souders: DoubleClick removed 1 client side redirect & cut 1.5 second in ad load time and increased CTR by 12% on mobile. Bryan McQuade #VelocityConf
App Cache saved 3s
Mobile RTT
2 - 3 seconds idle time if device is slow for 10s
if channel is active then the RTT is 40ms
Touch vs. Click = 300ms overhead saved
appspot.com for the
Reommendations: use Application Cache
high initial rtt
Reflows
Tony jetsburg width, height, are reflows.
This is added as a new rule.
Avoid long-running scripts
Page Speed for Chrome added three new rules
5:45pm modpagespeed
Need to understand the tradeoffs in the way that pages are built.
Inline images, browser support, build process, changing WPO recommendations.
Thursday, June 16th
8:30am - 12:00pm Demos and Keynotes
SSDs
- Go buy SSDs. Right Now! via @crucially #velocityconf
- I need an SSD in my life. Thanks Artur! #velocityconf
- "JOINs are fast. Fuck nosql" - @crucially making known his love of SSDs at #velocityconf. Use SSDs and "stop wasting your life".
- "If you don't have an SSD in your laptop, you are wasting your life." -@crucially Amen. #velocityconf
Prefetching Pages
Page Speed
New Page Speed Chrome beta! Detects extra reflows, excess network serialization, and long-running scripts. http://t.co/DsKZ2Sq
11:00am Browsers - Chrome
Mike Belshe (Google)
Networking
vs. CPU, rendering, JS.
See the HTTP Archive data.
Page Sizes are getting larger
WebP
TCP
Packet loss on the initial connnection. Spikes at 3, 9, 21.
Make SSL faster
-1 RT out of the initial handshake.
MObile
High RTT; SPDY alternative to HTTP.
Amazon: those guys know what they're doing and they optimize pretty well.
Gaming
3d CSS
Real Chrome Secret to Speed
TODO Chrome Developer Tools
Speed Tracer: stack trace on a layout.
requestAnimationFrame
Page Visibility
11:25am Browsers - Firefox
Chris Blizzard (Mozilla Foundation)
New object types
IO off the main loop
Increase the time in the timers for background tabs
People aren't using app cache
Rust and Servo
1:50am Instrumenting the real-time web
Wha Brian Cantrill's talk and view on the Robinson projection is quite hilarious #velocityconf
Bryan Cantrill just went from node.js and DTrace to flying into a rage over the Mercator projection. Hysterical. #velocityconf
http://www.slideshare.net/bcantrill/instrumenting-the-realtime-web
Base ideas
- Async (closures)
- High Performance VM (V8)
- Systems abstractions (UNIX)
Node Knockout
The leaderboard.
Using dtrace
dtrace -n io:::start
Kernel can't see interpreted languages with USDT
dtrace + ruby:
Implementing the leaderboard
libdtrace add-on for tickerd
- bcantrill/node-libdtrace
leaderd
git statistics was hardest part
github.com/silentrob/
Analytics
Agent Count Macintosh; Intel Mac OS X 1067 20 Windows NT 6.1; WOW64 4 Macintosh; U; Intel Mac OS X 1067; en-us 2 Macintosh; Intel Mac OS X 10.6; rv:2.0 2 iPhone; U; CPU iPhone OS 433 like Mac OS X; en-us 2 X11; U; Linux i686; en-US; rv:1.9.2.3 1 X11; SunOS i86pc 1 Windows NT 6.1; rv:2.0.1 1 Macintosh; Intel Mac OS X 107 1 Windows NT 6.1; WOW64; rv:2.0.1 1 Macintosh; U; Intel Mac OS X 1067; en-US 1 iPad; U; CPU OS 433 like Mac OS X; en-us 1 Macintosh; Intel Mac OS X 10.6; rv:2.0.1 1 Macintosh; Intel Mac OS X 1066 1 Macintosh; Intel Mac OS X 10.5; rv:2.0.1 1 Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.17 1 Macintosh; Intel Mac OS X 10.5; rv:5.0 1
2:40pm Performance Guides for Canvas
Sample from offline image
4:05pm Metrics-driven Engineering at Etsy
Kellan Elliott-McCrea (Etsy)
Metrics-driven Engineering at ETSY with @kellan up next #velocityconf
Why talk about metrics
Rates of failure across servers. Logging, correlations, etc.
Metrics are part of the product
…but make it easy
Ganglia and Graphite
Need to buffer logs to turn them into
accesslogs
All of the log information about the user is pushed into the Apache logs. None of this is standard.
statsd
NodeJS application. OCaml binding. Available in github.
logsterd
Deployments and Correlations
Determine alerting
Holt Winters Aberration
48 dashboards by 32 engineers
Made it easy to create and track.
Low MTTD but don't stop failures
Fall into the trap and start hiring QA engineers.
Log collection
QA Engineers
"If you don't know how you're doing you fall into fear and start hiring QA engineers & it's all downhill from there." @kellan #velocityconf
Working with Splunk can be painful
Web Fail Report links back to UAID.
Developers weren't excited to work with Splunk. Seemed to like Ganglia and Graphite.
Deployment
The code is monolythic. Doesn't include search or schema changes.
4:55pm Hacking Google Analytics to Track Arbitrary Data Artur Bergman (Wikia)
5:20pm The Impact of Ads on Performance and Improving Perceived Performance
Julia Lee (Yahoo!, Inc.)
Definitions
Deisplay Advertising
Ad creative
All assest
Ad decition time
Ad serving time
Ad rendering time
Aggregation of all factors in showing the ad.
No good metrics.
Timeline
Know the main measurements.
Mapped all of the rollouts to the measured times.
Measure download, latency of data
Ad defensive streategis
Ad handling library
- Ad content is in iframe
- Iframe is cross-domain url
- API that publishers and vendors can use
- Uses cross-domain messaging
Double buffering
- Use ad handling library to hook into events
- Perform the same position to have a page view to work with.
- Load the first ad into the iframe
- Load the second ad into the iframe under the first iframe.
- Whean the second ad is loaded the first iframe on top
loadAd('postion1')
Fine grained ad loading
- Sever vs. client
- Combine ad requests with ap[plication requests
- Delay ad loading to avoid browser contention
Users will wait until the spinner stops
This is the deficiency.
Web2.0 Ad Flow
Gets the ads as data to wait for the ad to be loaded as data.
Example: Mail read flow
Push it after the message processing.
Use the onload event in the iframe to determine when to rolled the buffered ad back into the frame.
Impact on users
No known impact, only a small user base.
Scenarios
Double buffering
setTimeout for the iframe
Check if the load even happened
This addresses the
Events are used to transfer information
Working with ad vendors was essentially boiling the ocean
What do we want to have ads do for security.
How do you stop a buffer from sliding in if the user is trying to click
Summary
Goal:
Consolidate the tools and analysis indicated at other conferences into a cohesive unit.
Overview:
The audience was a mixture of standard technical business and operations (the guys in t-shirts or rumpled short-sleeve shirts, shorts, and Tevas)
Even the best people for mobile (the Blaze.io guy) doesn't have precise information on the caching policies of the mobile web browser operating systems. The best source of data appears to be coming from Dion.
Much of the work centers on bringing the tools together. This might be the critical time for automation with the release of the source for ShowSlow and the PageSpeed API.
The initial goal should be to get Dynatrace for all JavaScript developers. This needs to be supported for smaller projects to confirm how the tool work.
Core goal was to establish that we need to continue to learn and that even base mathematics likely aren't followed by active practitioners.
The actual history shows the chaos of the languages, tools, professionalism, etc. of the web.
Problem:
- Any non-trivial app is difficult to review as a completed entity
- Monitoring performance has only recently been possible
- No obvious internal owner exists for performance
- Limited resources to both perform review and complete
- When issues seen no prioritization against feature development
- Any page test is hard to tell what is happening
- If resources are spent on monitoring is should be spent on tooling
- If issues are triaged are there resources to addressed
- When should performance issues be killed
Solution:
Need to begin with a general, high-level, set of numbers that indicate trending. However, most of these aren't entirely accurate or appropriate but only designed to indicate the scope of an actual review of site performance.
Example:
On an new, individual feature basis it's possible to run reasonable performance tests since profiling is reasonable and the amount of running JavaScript and the rendering limits are known to a single person.
Resources:
- Mobile developers
- Front-end engineers
- Performance engineer
Tasks
Review concatention policy based on revised Page Speed rules
Why a web page isn't the same as mobile
Grab all differences
click vs. touch
RT @andraz: Google's Engineers: there's a 300ms lag between mouse over the link and a click. We can start loading 300ms earlier! #velocityconf [smart++]
TODO Build a toolkit
Need build tools
Get dependency management, concatenation.
Create strategic tooling for mobile performance analysis
Evaluate m.instagrub.com
Interal WebPageTest
This should be allowed to have teams perform the review.
Traditionally the organization doesn't recognize that the site has changed but the cause isn't obvious. This provides a weekly walkthrough of the specifics of the results.
Example Blaze.io setup
Write expanded code so the JavaScript artifacts can be selectively removed from download queue
If you have a series of required files structure a development instance
Internal ShowSlow setup
Set up the beacon and run WebPageTest automatically.
This replicates the approach used for having an external server.
Prototype AngularJS
Consider a weekly performance review team for 6m
This would just use the YSlow metrics on a weekly basis and just walk through the specific page implementations.
What is the benefit to the organization by having a triage team or a weekly review of the actual breakdown in pages?
This would require that Operations and Front-end review the outcomes weekly to see what the structural changes are needed. Can't just be a single person report.
Push the idea of external monitoring of performance beyond Gomez
Prototype AngularJS
Dynatrace examples
Prototype Chef
Training Session: Performance monitoring, analysis, and deep dive
This also shows the ordering of the functionality.
Show all of the aggregated activities review.
This would need to be done during the development.
TODO WebDev Triage: Any front-facing action for the site (features, FlexPub, ads)
This isn't a specific problem that would need to be addressed but rather just a weekly triage of all of the performance issues on the site.
Triage also includes features under development. Intended to simplify the analysis of mobile web development.
Broadly include any resource but only pull in people that have issues that are opened. If issues are found when would they be closed out? What would the organizational value be?
Dynatrace JavaScript/AJAX report includes contributor
Workflow for performance review
Create a site baseline
Track the overall scores
Create internal tools to allow
Review Chef
Joshua Timberman (Opscode, Inc.), Adam Jacob (Opscode), Christopher Brown (Opscode), Aaron Peterson (Opscode, Inc.), Matt Ray (Opscode), Seth Chisamore (Opscode, Inc.)
Push Seattle Speed
This mirrors
- Boston Web Performance Group
http://www.meetup.com/Web-Performance-Boston/
- New York Web Performance Group
http://www.nywebperformance.org/
- San Francisco & Silicon Valley Web Performance Group
http://www.meetup.com/SF-Web-Performance-Group/
- London Web Performance Meetup
- Paris
- LA Speed
Could be done through the Seattle JS group.
Emphasize the tools used beyond just the debugger.
- Case 1: Your own project
- Case 2: Review something not your own
Tools are the emphasis.
Statistics
Binomial Distribution binomdist(3,4,5)
pcap and httptrace
Install node-bench
This is an isasacs project.
Create a node
JavaScript API design in Node and CoffeeScript
Internal resource allocation
Developers, unless independently focussed on mobile web won't have time to build tools in addition to feature development.
Client Tech
Primary feature development team.
Checkout
FlexPub
WOPR
Internal projects to get people up to speed
Doing development with best practices will require that people practice before the actual development. In order to work with teams internally these would need to be done with other people to ensure some approaches are standardized.
In particular, some HTML5 features wouldn't be supported, but static designs will indicate that features should be hacked in. Without correct tools (including debuggers, proxies, emulators, or physical devices) any individual couldn't successfully complete a project.
Perform the base mobile standard for the home page
Know trade-off between design, feature, analytics, and performance
Additional cost for removing jQuery-specific features for Selectors API
Even using libraries there's significant risk to adding lots of dynamic features.
Review mini-Frameworks for mobile (Zepto)
Using application cache complicate updates needs vetting with CM
Alternatively look at using localStorage
Server can reply with everything inline + cookie
Only provide the basic HTML and JavaScript.
This is used by Bing and Google.
Prototype querySelectorAll
TODO Implement a Backbone (MVC) prototype
TODO Implement Knockout (MVVM)
Define the policy on data objects for constructors
FB.ui
http://developers.facebook.com/docs/reference/javascript/FB.ui/ FB.ui(data, callback(response))
SproutCore: data, callback
http://docs.sproutcore.com/#doc=SC.Object&src=false This should include the use of the standar
Perform a sumamry of the types of object construction and APIs
This should be done with a local install of a code review tool.
Knockout
Many cases of the namespace.item = new (function () { return { functions… })…
EloquentJS
Push client templating solution
Push a script loader
This is for performance.
Review concatantion strategy
Changes to the Recommended performance approach
Changes to account for modern browsers also considering mobile.
- Parallized domains (not done)
Inherency: when to make changes to the performance approach
This
Test offline support for mobile app
http://www.html5rocks.com/en/tutorials/appcache/beginner/
Allows a freshness test from a single request.
People still aren't using large chunks of the newer features.
WebPageTest without ads or JavaScript
Web + Mobile Performance Tools
Chrome
Firebug
Safari
Console updates in Firebug and Chrome
console.timeStamp()