The document discusses optimizing JavaScript performance for Yahoo's homepage. It describes techniques used such as:
1. Loading non-critical JavaScript asynchronously and lazily to improve time to interactivity.
2. Splitting long-running JavaScript tasks into smaller chunks with timers to maintain responsiveness.
3. Using Web Workers to offload CPU-intensive tasks without blocking the UI thread.
4. Caching and preloading resources to reduce roundtrip times for Ajax requests.
The techniques helped optimize performance by reducing JavaScript parsing time and improving responsiveness.
High Performance JavaScript - Fronteers 2010Nicholas Zakas
For much of its existence, JavaScript has been slow. No one complained until developers created complex web applications with thousands of lines of JavaScript code. Although newer JavaScript engines have improved the situation, there's still a lot to understand about what makes JavaScript slow and what you can do to speed up your code.
Overhauling one of the most visited web sites in the world is a major task, and add on top of it the pressure of keeping performance the same while adding a ton of new features, and you have quite a task. Learn how the Yahoo! homepage team achieved performance parity with the previous version even while adding a ton of new features.
High Performance JavaScript (YUIConf 2010)Nicholas Zakas
Ever wonder why the page appears frozen or why you get a dialog saying, "this script is taking too long"? Inside of the browser, JavaScript and the page's UI are very intertwined, which means they can affect each other and, in turn, affect overall page performance. Ensuring the fastest execution time of JavaScript code isn't about geek cred, it's about ensuring that the user experience is as fast and responsive as possible. In a world where an extra second can cost you a visitor, sluggishness due to poor JavaScript code is a big problem. In this talk, you'll learn what's going on inside the browser that can slow JavaScript down and how that can end up creating a "slow page". You'll also learn how to overcome the conspiracy against your code by eliminating performance bottlenecks.
YUI Test The Next Generation (YUIConf 2010)Nicholas Zakas
JavaScript testing has grown by leaps and bounds over the past few years. When YUI Test was first introduced in 2007, it was just the first step in a long process of bringing test-driven development to the front end. YUI Test evolved with the release of YUI 3 to introduce mock objects as feedback indicated a need. As feedback continued to come in, YUI Test continued to evolve. Learn about the next version of YUI Test, how it makes testing any JavaScript code easier, and the brand new tools that allow you to integrate your testing into a continuous integration environment.
High Performance JavaScript - WebDirections USA 2010Nicholas Zakas
Ever wonder why the page appears frozen or why you get a dialog saying, “this script is taking too long”? Inside of the browser, JavaScript and the page’s UI are very intertwined, which means they can affect each other and, in turn, affect overall page performance. Ensuring the fastest execution time of JavaScript code isn’t about geek cred, it’s about ensuring that the user experience is as fast and responsive as possible. In a world where an extra second can cost you a visitor, sluggishness due to poor JavaScript code is a big problem. In this talk, you’ll learn what’s going on inside the browser that can slow JavaScript down and how that can end up creating a “slow page”. You’ll also learn how to overcome the conspiracy against your code by eliminating performance bottlenecks.
After consulting with several companies on performance related issues, it became clear that one of the biggest performance issues facing websites today is the sheer amount of JavaScript needed to power the page. The demand for more interactive and responsive applications has driven JavaScript usage through the roof. It’s quite common for large sites to end up with over 1 MB of JavaScript code on their page even after minification. But do today’s web applications really need that much JavaScript?
High Performance JavaScript - Fronteers 2010Nicholas Zakas
For much of its existence, JavaScript has been slow. No one complained until developers created complex web applications with thousands of lines of JavaScript code. Although newer JavaScript engines have improved the situation, there's still a lot to understand about what makes JavaScript slow and what you can do to speed up your code.
Overhauling one of the most visited web sites in the world is a major task, and add on top of it the pressure of keeping performance the same while adding a ton of new features, and you have quite a task. Learn how the Yahoo! homepage team achieved performance parity with the previous version even while adding a ton of new features.
High Performance JavaScript (YUIConf 2010)Nicholas Zakas
Ever wonder why the page appears frozen or why you get a dialog saying, "this script is taking too long"? Inside of the browser, JavaScript and the page's UI are very intertwined, which means they can affect each other and, in turn, affect overall page performance. Ensuring the fastest execution time of JavaScript code isn't about geek cred, it's about ensuring that the user experience is as fast and responsive as possible. In a world where an extra second can cost you a visitor, sluggishness due to poor JavaScript code is a big problem. In this talk, you'll learn what's going on inside the browser that can slow JavaScript down and how that can end up creating a "slow page". You'll also learn how to overcome the conspiracy against your code by eliminating performance bottlenecks.
YUI Test The Next Generation (YUIConf 2010)Nicholas Zakas
JavaScript testing has grown by leaps and bounds over the past few years. When YUI Test was first introduced in 2007, it was just the first step in a long process of bringing test-driven development to the front end. YUI Test evolved with the release of YUI 3 to introduce mock objects as feedback indicated a need. As feedback continued to come in, YUI Test continued to evolve. Learn about the next version of YUI Test, how it makes testing any JavaScript code easier, and the brand new tools that allow you to integrate your testing into a continuous integration environment.
High Performance JavaScript - WebDirections USA 2010Nicholas Zakas
Ever wonder why the page appears frozen or why you get a dialog saying, “this script is taking too long”? Inside of the browser, JavaScript and the page’s UI are very intertwined, which means they can affect each other and, in turn, affect overall page performance. Ensuring the fastest execution time of JavaScript code isn’t about geek cred, it’s about ensuring that the user experience is as fast and responsive as possible. In a world where an extra second can cost you a visitor, sluggishness due to poor JavaScript code is a big problem. In this talk, you’ll learn what’s going on inside the browser that can slow JavaScript down and how that can end up creating a “slow page”. You’ll also learn how to overcome the conspiracy against your code by eliminating performance bottlenecks.
After consulting with several companies on performance related issues, it became clear that one of the biggest performance issues facing websites today is the sheer amount of JavaScript needed to power the page. The demand for more interactive and responsive applications has driven JavaScript usage through the roof. It’s quite common for large sites to end up with over 1 MB of JavaScript code on their page even after minification. But do today’s web applications really need that much JavaScript?
In the beginning, progressive enhancement was simple: HTML layered with CSS layered with JavaScript. That worked fine when there were two browsers, but in today's world of multiple devices and multiple browsers, it's time for a progressive enhancement reboot. At the core is the understanding that the web is not print - the same rules don't apply. As developers and consumers we've been fooled into thinking about print paradigms for too long. In this talk, you'll learn just how different the web is and how the evolution of progressive enhancement can lead to better user experiences as well as happier developers and users.
This deck is a conference-agnostic one, suitable to be shown anywhere without site-specific jokes!
jQuery 1.9 and 2.0 - Present and FutureRichard Worth
jQuery has grown over 7 years to become the most widely used JavaScript library ever. This talk will cover how the jQuery project continues to support the browsers of the past, present, and future while also delivering modularity, innovation, and mobile support.
The average website loads over 1.5MBs of content per page, making over 75 requests. Many popular websites are serving over 5MBs just to load their homepages. And these numbers represent measurements taken AFTER compression is applied. The full weight of many popular websites is pushing 20+ MBs these days. In an era where performance truly matters to the end user experience, web developers need techniques to help curtail this bloat in data down the wire.
No matter how well you optimize, there is no better way than to delete things you do not need. How does one determine what is essential to the user experience and what is not? One answer Chris posits is to develop a hyper-lightweight version of your website which will provide critical insights into your specific performance priorities. This is a process that he has leveraged on many projects, in particular at YouTube to reduce the size of the video watch page from 1.5MBs to 100KBs. In this talk, Chris will take real-world web pages and show techniques for dramatically reducing their page weight and for identifying areas to optimize, while outlining the key steps to doing this well.
What to look for and avoid when it comes to 3rd party snippets. How to test your site for frontend SPOF. Use the self-updating script pattern to increase the cacheability of bootstrap scripts.
As browsers explode with new capabilities and migrate onto devices users can be left wondering, “what’s taking so long?” Learn how HTML, CSS, JavaScript, and the web itself conspire against a fast-running application and simple tips to create a snappy interface that delight users instead of frustrating them.
In this talk, Chris Mills discusses the historic problems with web apps and which technologies are stepping up to fill the holes. This includes device APIs such as Web Activities, Camera, device orientation and nfc, offline apps (which are finally looking realistic thanks to service workers), installable apps, and high quality games and other immersive high performance experiences using such features as Web audio API, Pointer lock, asm.js and Emscripten.
Web developers now have a large number of APIs available allowing them to harness complex functionality via JavaScript and produce ever more interesting web experiences. This presentation looks at where we can from, where APIs are going in the future, and what problems we are currently in the process of solving. This includes Multimedia, Offline, device hardware access, internationalization, and more.
Web developers now have a large number of APIs available allowing them to harness complex functionality via JavaScript and produce ever more interesting web experiences. This presentation looks at where we can from, where APIs are going in the future, and what problems we are currently in the process of solving. This includes providing offline installation, multimedia, performance, and more.
This talk is geared towards users of jQuery plugins who are looking to pick the best plugins and plugin authors who would like a holistic review of existing jQuery plugins and what things to consider when making your own plugins. Marketing tactics and approaches to spreading the word about your plugin will also be discussed.
How To Build a Multi-Field Search Page For Your XPages ApplicationMichael McGarel
This is a five-minute presentation from the 2013 IBM Connect conference. I show one way to build a faceted search page using IBM's XPages platform as part of the annual SpeedGeeking session. It includes sample code and links the the project I posted on OpenNTF.org.
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Nicholas Zakas
In the beginning, progressive enhancement was simple: HTML layered with CSS layered with JavaScript. That worked fine when there were two browsers, but in today's world of multiple devices and multiple browsers, it's time for a progressive enhancement reboot. At the core is the understanding that the web is not print - the same rules don't apply. As developers and consumers we've been fooled into thinking about print paradigms for too long. In this talk, you'll learn just how different the web is and how the evolution of progressive enhancement can lead to better user experiences as well as happier developers and users.
My talk at the January 21, 2009 Mountain View JavaScript Meetup about the performance of JavaScript variables relative to their position in the scope chain.
In the beginning, progressive enhancement was simple: HTML layered with CSS layered with JavaScript. That worked fine when there were two browsers, but in today's world of multiple devices and multiple browsers, it's time for a progressive enhancement reboot. At the core is the understanding that the web is not print - the same rules don't apply. As developers and consumers we've been fooled into thinking about print paradigms for too long. In this talk, you'll learn just how different the web is and how the evolution of progressive enhancement can lead to better user experiences as well as happier developers and users.
This deck is a conference-agnostic one, suitable to be shown anywhere without site-specific jokes!
jQuery 1.9 and 2.0 - Present and FutureRichard Worth
jQuery has grown over 7 years to become the most widely used JavaScript library ever. This talk will cover how the jQuery project continues to support the browsers of the past, present, and future while also delivering modularity, innovation, and mobile support.
The average website loads over 1.5MBs of content per page, making over 75 requests. Many popular websites are serving over 5MBs just to load their homepages. And these numbers represent measurements taken AFTER compression is applied. The full weight of many popular websites is pushing 20+ MBs these days. In an era where performance truly matters to the end user experience, web developers need techniques to help curtail this bloat in data down the wire.
No matter how well you optimize, there is no better way than to delete things you do not need. How does one determine what is essential to the user experience and what is not? One answer Chris posits is to develop a hyper-lightweight version of your website which will provide critical insights into your specific performance priorities. This is a process that he has leveraged on many projects, in particular at YouTube to reduce the size of the video watch page from 1.5MBs to 100KBs. In this talk, Chris will take real-world web pages and show techniques for dramatically reducing their page weight and for identifying areas to optimize, while outlining the key steps to doing this well.
What to look for and avoid when it comes to 3rd party snippets. How to test your site for frontend SPOF. Use the self-updating script pattern to increase the cacheability of bootstrap scripts.
As browsers explode with new capabilities and migrate onto devices users can be left wondering, “what’s taking so long?” Learn how HTML, CSS, JavaScript, and the web itself conspire against a fast-running application and simple tips to create a snappy interface that delight users instead of frustrating them.
In this talk, Chris Mills discusses the historic problems with web apps and which technologies are stepping up to fill the holes. This includes device APIs such as Web Activities, Camera, device orientation and nfc, offline apps (which are finally looking realistic thanks to service workers), installable apps, and high quality games and other immersive high performance experiences using such features as Web audio API, Pointer lock, asm.js and Emscripten.
Web developers now have a large number of APIs available allowing them to harness complex functionality via JavaScript and produce ever more interesting web experiences. This presentation looks at where we can from, where APIs are going in the future, and what problems we are currently in the process of solving. This includes Multimedia, Offline, device hardware access, internationalization, and more.
Web developers now have a large number of APIs available allowing them to harness complex functionality via JavaScript and produce ever more interesting web experiences. This presentation looks at where we can from, where APIs are going in the future, and what problems we are currently in the process of solving. This includes providing offline installation, multimedia, performance, and more.
This talk is geared towards users of jQuery plugins who are looking to pick the best plugins and plugin authors who would like a holistic review of existing jQuery plugins and what things to consider when making your own plugins. Marketing tactics and approaches to spreading the word about your plugin will also be discussed.
How To Build a Multi-Field Search Page For Your XPages ApplicationMichael McGarel
This is a five-minute presentation from the 2013 IBM Connect conference. I show one way to build a faceted search page using IBM's XPages platform as part of the annual SpeedGeeking session. It includes sample code and links the the project I posted on OpenNTF.org.
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Nicholas Zakas
In the beginning, progressive enhancement was simple: HTML layered with CSS layered with JavaScript. That worked fine when there were two browsers, but in today's world of multiple devices and multiple browsers, it's time for a progressive enhancement reboot. At the core is the understanding that the web is not print - the same rules don't apply. As developers and consumers we've been fooled into thinking about print paradigms for too long. In this talk, you'll learn just how different the web is and how the evolution of progressive enhancement can lead to better user experiences as well as happier developers and users.
My talk at the January 21, 2009 Mountain View JavaScript Meetup about the performance of JavaScript variables relative to their position in the scope chain.
For much of its existence, JavaScript has been slow. No one complained until developers created complex web applications with thousands of lines of JavaScript code. Although newer JavaScript engines have improved the situation, there’s still a lot to understand about what makes JavaScript slow and what you can do to speed up your code.
Writing code as an individual and writing code as part of the team are two very different things. Learn the tips and tricks for writing JavaScript code as part of the team so that your code will continue to work for years to come.
CyberArk Impact 2017 - REST for the Rest of UsJoe Garcia
Are you a Vault Admin drowning in work? Unfortunately, the great minds at CyberArk haven’t figured out a way to clone you… yet. In the meantime, there’s the REST API to help you along the way!
Come POST up in a chair and GET your paper and pencils ready…our REST expert is about to PUT knowledge in your brain and DELETE your old way of thinking! After this session, you’ll leave with a better understanding of our REST API, how to easily combine multiple methods to create simple scripts, and tips on how to use Postman to your benefit.
Model-based engineering of multi-platform, synchronous & collaborative UIsJean Vanderdonckt
The paper describes an engineering method for building user interfaces for ubiquitous environments. The method comprises of several extensions in the UsiXML family
of modes as well as design and runtime support so as to enable multi-platform, synchronous and collaborative interactions. We demonstrate key concepts of the method and their application by elaborating a scenario of collaborative co-play
of the ‘tic-tac-toe’ game. The specific use case features synchronous co-engagement in game play by remote users (players or observers) using desktop PCs or Android devices.
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyMark Proctor
This is an overview video that shows the scope of work and technology used within the Red Hat JBoss BRMS and BPMS platforms.
The technology presented builds with GWT, Errai and UberFire as the foundation. Over 2015 we'll be working to make it for end users to consume the bits they need, paying for only what they use, so others can make power web platforms like BRMS and BPMS.
Getting Started with XCTest and XCUITest for iOS App TestingBitbar
Watch a live presentation at http://offer.bitbar.com/getting-started-with-xctest-and-xcuitest-for-ios-app-testing
XCTest has been part of Xcode for few years already, but it is finally catching up and more developers are getting on the bandwagon. XCTest and XCUITest provide feature-rich capabilities for iOS developers and test automation folks to implement different levels of tests using Xcode features and supported programming languages, Objective-C and Swift.
Stay tuned and join our upcoming webinars at http://bitbar.com/testing/webinars/
Believe it or not, accessibility is more than just screen readers. There's a whole group of users who only use a keyboard (without a mouse). Learn how to make the web a friendly place for all kinds of people by ensuring keyboard accessibility.
An update to the Scalable JavaScript presentation of 2009. Describes how to piece together a JavaScript application framework designed for maintainability.
Writing JavaScript as a hobby and writing JavaScript as a job are two very different things. Learn some common practices for making your JavaScript friendly to a team environment.
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Ramesh Iyer
In today's fast-changing business world, Companies that adapt and embrace new ideas often need help to keep up with the competition. However, fostering a culture of innovation takes much work. It takes vision, leadership and willingness to take risks in the right proportion. Sachin Dev Duggal, co-founder of Builder.ai, has perfected the art of this balance, creating a company culture where creativity and growth are nurtured at each stage.
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
Neuro-symbolic is not enough, we need neuro-*semantic*Frank van Harmelen
Neuro-symbolic (NeSy) AI is on the rise. However, simply machine learning on just any symbolic structure is not sufficient to really harvest the gains of NeSy. These will only be gained when the symbolic structures have an actual semantics. I give an operational definition of semantics as “predictable inference”.
All of this illustrated with link prediction over knowledge graphs, but the argument is general.
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Tobias Schneck
As AI technology is pushing into IT I was wondering myself, as an “infrastructure container kubernetes guy”, how get this fancy AI technology get managed from an infrastructure operational view? Is it possible to apply our lovely cloud native principals as well? What benefit’s both technologies could bring to each other?
Let me take this questions and provide you a short journey through existing deployment models and use cases for AI software. On practical examples, we discuss what cloud/on-premise strategy we may need for applying it to our own infrastructure to get it to work from an enterprise perspective. I want to give an overview about infrastructure requirements and technologies, what could be beneficial or limiting your AI use cases in an enterprise environment. An interactive Demo will give you some insides, what approaches I got already working for real.
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...UiPathCommunity
💥 Speed, accuracy, and scaling – discover the superpowers of GenAI in action with UiPath Document Understanding and Communications Mining™:
See how to accelerate model training and optimize model performance with active learning
Learn about the latest enhancements to out-of-the-box document processing – with little to no training required
Get an exclusive demo of the new family of UiPath LLMs – GenAI models specialized for processing different types of documents and messages
This is a hands-on session specifically designed for automation developers and AI enthusiasts seeking to enhance their knowledge in leveraging the latest intelligent document processing capabilities offered by UiPath.
Speakers:
👨🏫 Andras Palfi, Senior Product Manager, UiPath
👩🏫 Lenka Dulovicova, Product Program Manager, UiPath
22. How Long Is Too Long?
“0.1 second [100ms] is about the limit for
having the user feel that the system is reacting
instantaneously, meaning that no special
feedback is necessary except to display the
result.”
- Jakob Nielsen
23. Translation:
No single JavaScript job should
execute for more than 100ms to
ensure a responsive UI
28. JavaScript Timers
• Created using setTimeout()
• Schedules a new JavaScript execution job for
some time in the future
• When the delay is up, the job is added to the
UI queue
– Note: This does not guarantee execution
after the delay, just that the job is added
to the UI queue and will be executed when
appropriate
29. JavaScript Timers
• For complex processing, split up into timed
functionality
• Use timers to delay some processing for later
30. function timedProcessArray(items, process, callback){
//create a clone of the original
var todo = items.concat();
setTimeout(function(){
var start = +new Date();
do {
process(todo.shift());
} while (todo.length > 0 &&
(+new Date() - start < 50));
if (todo.length > 0){
setTimeout(arguments.callee, 25);
} else {
callback(items);
}
}, 25);
}
41. Web Workers
• Asynchronous JavaScript execution
• Execution happens in a separate process
– Not on the UI thread = no UI delays
• Data-driven API
– Data is serialized when sending data into
or out of Worker
– No access to DOM, BOM
– Completely separate execution
environment
42. //in page
var worker = new Worker("process.js");
worker.onmessage = function(event){
useData(event.data);
};
worker.postMessage(values);
//in process.js
self.onmessage = function(event){
var items = event.data;
for (var i=0,len=items.length; i < len; i++){
process(items[i]);
}
self.postMessage(items);
};
60. The Cost of Customization
• Spriting is difficult
– Hard to know which images will be on the
page together
• Limited image caching
– With content constantly changing, getting
images into cache doesn't help much
• A lot more JavaScript/CSS
– And very different, depending on how the
user has customized the page
61. Areas of Focus
• Time to interactivity
• Ajax Responsiveness
flickr.com/photos/hape_gera/2123257808/
62. The time to interactivity is the
time between the initial page
request and when the user can
complete an action
63. Time to Interactivity
• For most pages, happens between
DOMContentLoaded and onload
– Can actually happen earlier
• Links work, forms can be submitted even while
the page is loading
– As long as JavaScript isn't running
• Difficult to measure
64. Net tab reveals some information
Where DOMContentLoaded and onload occur
65. YSlow reports onload time
Useful, but doesn't really determine time to interactivity
67. Simple User Actions
• Clicking a headline to read the story
• Performing a search
• Clicking on a favorite
Wait a second!
You don't need JavaScript
for any of that!
flickr.com/photos/marcoarment/2035853550/
75. flickr.com/photos/kartik_m/2724121901/
Results
• Page would fully render, but be frozen
– User can't interact while JavaScript is being
fetched/parsed/executed
• Delayed onload to after 5s on fast connection
• Time to interactivity tied to onload
• Experience was especially bad over slower
connections
– Page was unresponsive for 30s or more
83. flickr.com/photos/nateandmiranda/2625399653/
Results
• Page is interactive as
soon as each section
is rendered
• Reduced onload time
to ~2.5s on fast
connections
• Slow connection
experience vastly
improved
84. JavaScript Loads
• Small amount on page load
• Larger amount loaded in non-blocking manner
– Everything necessary for core JavaScript
interactivity
• Ajax responses can specify more JavaScript is
needed to handle the response
– True, on-demand loading
85. Areas of Focus
• Time to interactivity
• Ajax Responsiveness
flickr.com/photos/hape_gera/2123257808/
86. The biggest area of concern regarding Ajax
performance was around the apps. For our very
first test, it sometimes took as long as 7 seconds
to load a single app.
87. start stop
What exactly is taking 7 seconds?
The measurement itself was a huge black box – before doing anything,
we had to figure out exactly what was happening in that time
88. roundtrip
start stop
Roundtrip Time
The first step is the amount of time between when the browser sends
the request and the time it receives the response
89. roundtrip parse
start stop
Parse Time
Next, the JSON response returned from the server has to be parsed
90. roundtrip parse download
start stop
JavaScript/CSS Download Time
Each response can indicate it needs more JavaScript/CSS before the
content can be used
91. roundtrip parse download render
start stop
Render Time
The amount of time it takes to actually change the display via innerHTML
94. The right-side ads were a roundtrip issue
The server-side ad call took extra time plus the ad markup represented
50-60% of the returned markup
95. “Fixing” the ad
Entire right column now renders in an iframe. This defers the ad call
until after the app has been loaded in the browser, saving both
server time for app rendering and bytes in the response.
100. The larger the JSON string, the
longer it took to parse
Keep in mind there was no native browser JSON parsing when we
began testing the new page
The regular expression validation in the YUI JSON utility (based on
json2.js) could take up to 40% of the parse time
101. Shrinking the size of the HTML by
deferring the ad helped
But we still wanted to see if we could eek out better gains
102. [{
"msg": "Hello world!",
"day": 6,
"found": true,
}]
=====
<div class="foo"><a href="http://www.yahoo.com">Yahoo!
</a></div>
We experimented with an alternate response format where meta
data was in JSON form but HTML was included afterward in plain
text
105. On-demand JavaScript/CSS
downloading hurt app loading
time
Intended to decrease page load time, and did – but left us with this
side effect
106. Waiting until the user takes
an action ensures paying the
cost of download
What if you knew which
apps the user was going to
use?
Solution: predictive fetch of
JavaScript/CSS before you
need it
flickr.com/photos/mcgraths/3248483447/
107. After page load, we start to
download JavaScript/CSS for
the apps on the page
116. Avoid Slow Loading JavaScript
• Put scripts at the bottom
• Concatenate scripts into as few files as
possible
• Choose the right way to load your scripts
– Dynamically created scripts
– Deferred scripts
– Asynchronous scripts
117. Avoid Slow JavaScript
• Don't allow JavaScript to execute for more
than 50ms
• Break up long JavaScript processes using:
– Timers
– Web Workers
118. Lessons Learned
• Time to interactivity is a big deal
• Progressive enhancement creates a better
experience
– Allows for delayed load of JavaScript
• Load as much JavaScript as possible in a non-
blocking manner
• Ajax performance is a macro measurement
– Get more insight by looking at the parts
119. Achievements
• Reduced time to onload from ~5s to ~2.5s
– Actually better than previous version
• Very short time to interactivity
• Reduced time to open apps from ~7s to ~2s
• Maintained perception of speed from previous
version
flickr.com/photos/ficken/1813744832/