Welcome!

Agile Computing Authors: Larry Alton, Elizabeth White, Dean Madison, Pat Romanski, Astadia CloudGPS

Related Topics: Agile Computing, Machine Learning

Agile Computing: Article

Top Ten Client-Side Performance Problems in Web 2.0

Top problems seen when working with our dynaTrace AJAX Edition users

Inspired by the Top 10 Performance Problems post which focuses on Server-Side performance problems taken from companies such as Zappos, Thomson, Monster and Novell I came up with the Top 10 Client-Side performance problems in Web 2.0 applications I’ve seen when working with our dynaTrace AJAX Edition users.

Symptom: JavaScript blocking resource downloads and slowing page load time
JavaScript opened the door for Web 2.0 applications. Since JavaScript is used on almost every web site traditional methods to analyze web site performance don’t always give you all the answers for a slow running page. Looking at a network waterfall diagram is the typical way to start analyzing a page and all its requests. Most browser performance tools support a network waterfall diagram. It shows which resources got downloaded and how much time the browser had to wait for all these resources to be downloaded.

In Web 2.0 applications it is no longer just the network downloads that contribute to the page load time. We start seeing blank spots between downloads where the browser is busy with other stuff. These blanks are usually explained with JavaScript execution where the browser stops all network activity:

Network Waterfall Diagram with blank spots that can be explained with JavaScript execution

Network Waterfall Diagram with blank spots that can be explained with JavaScript execution

Tools such as dynaTrace AJAX Edition or Google Speed Tracer allow analyzing these blank spots that block further network downloads as they analyze JavaScript execution, DOM access and Rendering activity in the browser while loading a page:

dynaTrace Timeline view shows what happens in these blind network spots

dynaTrace Timeline view shows what happens in these blind network spots

Long running JavaScript executed when JavaScript files are loaded cause the browser to suspend download of remaining network resources and therefore slows down the overall page load time.

Further Reading: Best Practices on Blocking and long running script tags

Top 10 Problems that explain these symptoms

The following is a list problems that explain most of these symptoms of long running and blocking JavaScript.

#1: Slow CSS Selectors on Internet Explorer
The #1 performance problem causing slow running or blocking JavaScript are slow running CSS Selectors in Internet Explorer. Web developers make use of lookup methods via CSS Selectors provided by JavaScript frameworks such as jQuery or Prototype. A common way to lookup elements is by using the CSS class name.

var element = $(“.shoppingcart”)

Internet Explorer 6 and 7 does not provide a native implementation for this lookup. jQuery/Prototype therefore needs to iterate through the whole DOM tree to perform the lookup purely through JavaScript. This iteration takes much longer than a native implementation provided in other browsers. The iteration is also heavily impacted by the DOM Size. The following image shows CSS lookups executed on a single page with the Total Execution Time (in ms) of these individual lookups on Internet Explorer. Many calls like this can make up several seconds on an individual page

dynaTrace AJAX analysis and highlights slow CSS Selectors

dynaTrace AJAX analysis and highlights slow CSS Selectors

Internet Explorer 8 provides better support for CSS Lookups. In order to take advantage of this it is important to upgrade to the latest versions of your JavaScript framework, e.g: jQuery/Prototype. Many websites are still stuck with older versions that do not leverage these new features making these pages also slow in the latest version of Internet Explorer.

Further Reading: Best Practices on Slow CSS Selectors with jQuery/Prototype

#2: Multiple CSS Lookups for same object
Individual CSS Lookups can be expensive. Executing the same lookup multiple times on the same page adds more execution time than necessary. Instead of executing the same lookup multiple times it is recommended to store the result of a lookup in a variable and reuse it on that same page. The following image shows the number of CSS Lookups for individual CSS Selectors on a single page. Some of them are called up to 10 times

dynaTrace analysis how often a CSS Selector got executed on a single page

dynaTrace analysis of how often a CSS Selector was executed on a single page

The 8 invocations to .ztBucket take a total of 660ms. Calling it only once and reusing the lookup result can reduce this total time to ~80ms

#3: Too many XHR Calls
JavaScript and XmlHttpRequests are the basis for what in general is called AJAX. Frameworks like jQuery make it very easy to make AJAX calls in order to retrieve additional content from the server. An example would be the implementation of a paging mechanism. Instead of downloading all pages at once only the first page is downloaded. When the user navigates to the next page we request the next page via an AJAX call and refresh the DOM. This avoids a full roundtrip and avoids the browser reloading the whole page.

A mistake that is often made is that too much information is fetched dynamically with too many calls. One example is a product page with 10 products. The developer may decide to use AJAX to load detailed product information for every product individually. This means 10 XHR calls for every 10 products that are displayed. This will of course work but it means that you have 10 roundtrips to the server that lets the user wait for the final result. The server needs to handle 10 additional requests that puts additional pressure on the server infrastructure.

Instead of making 10 individual requests it is recommended to combine these calls into a single batch call requesting the product details for all 10 products on the page.

Further Reading: AJAX Best Practices to reduce and aggregate XHR Calls, Best Practices on too many XHR Calls

#4: Expensive DOM Manipulations
Manipulating the DOM is necessary in highly interactive web sites. Dynamically loaded content needs to be added to the site or user preference changes need to be applied in order to change the look and feel of the website.

There are multiple ways to add new DOM elements – each with a different performance impact depending on the browser and the number of elements that are added. It is important to analyze different approaches (e.g: adding elements as HTML or creating individual DOM elements) and apply the approach that works best in each use case.

#5: Too many JavaScript files
The more JavaScript files there are on the page – the more often the browser needs to switch context with the JavaScript engine when loading these files. It is not uncommon to see web sites with 40 or more individual JavaScript files. Besides having additional context switches with the JavaScript engine the additional network roundtrips to download these JavaScript files have a significant impact on overall page load time.

A solution to this problem is merging individual JavaScript files into fewer. This saves on roundtrips and context switches for the JavaScript engine.

#6: Large DOM
The size of the DOM plays an important role in page performance. The larger the DOM:

  • the more memory is required by the browser
  • the longer manipulations take as style changes on top nodes need to be applied to more child nodes
  • especially on Internet Explorer larger DOMs have a disadvantage when performing certain CSS Lookups, e.g: by class name
  • any custom JavaScript that iterates through the DOM will become slower

Further Reading: Optimizing Data Intensive Webpages by Example

#7: Excessive Event Handler Bindings
Frameworks like jQuery, Prototype or YUI make it easy to bind event handlers to certain types of DOM elements, e.g.: all Hyperlinks. Binding event handlers to DOM elements impacts performance in 3 ways:

  1. the binding itself takes time as objects need to be looked up and are either registered to a central event manager or DOM elements are modified by assigning the handler method to it
  2. whenever an event is triggered the event manager needs to lookup the elements that have registered for that event and then call the correct event handlers (only true when using event managers)
  3. event handlers need to be unbound when moving to a different page. This has to be done in order to avoid any DOM-related memory leaks

The following image shows the internals of an event manager that needs to lookup all elements to identify which element to handle the actual event

Event Manager that needs to perform expensive CSS Lookups to resolve objects

Event Manager that needs to perform expensive CSS Lookups to resolve objects

#8: Slow executing external services
Many web pages embed external content (Ad Banners, Facebook Connect, …) or call external services (End User Monitoring, Review Information, …). This content is usually included by including a JavaScript file from this 3rd party provider. Very often these JavaScript files show common performance problems such as expensive CSS Lookups or DOM Manipulations. It is important to analyze 3rd party content and talk with 3rd party content providers to fix problems in their code in case it impacts web site performance. Often an upgrade to a newer version solves the problem. The following screenshot shows JavaScript execution that collects information for end-user monitoring purposes. It adds several hundred ms on each visited page and therefore impacts end-user performance:

Long running JavaScript code from a 3rd party library

Long running JavaScript code from a 3rd party library

#9: Excessive Visual Effects
Many JavaScript libraries provide nice visual effects, e.g: dynamic popup menus, accordion effects, etc. Where most of these frameworks do a good job on sample web sites, some of them do not perform well on real life pages with large DOMs. It is important to analyze the impact of visual effects on the browser’s CPU, the rendering engine and the overall web site performance

Further Reading: Performance Analysis of dynamic JavaScript menus

#10: Too fine granular logging and monitoring
Custom or third-party logging and monitoring frameworks allow the collection of very detailed information about user interaction. A common problem is that too much information is collected which results in additional overhead in the JavaScript engine as well as on the network as the collected data needs to be sent to a monitoring or logging service. Logging every mouse move for instance might seem like a good idea but can easily end up in blocking browsers (too much JavaScript execution) or congested services (too many logging calls to the monitoring/logging service)

Further Readings: How to Automate Google Analytics Analysis, Combining Analytics with Performance Management Data

Yes – there is more to Web 2.0 Performance Analysis
This list is by far not complete. For more information check out the blogs we wrote on JavaScript/AJAX, Best Practices from Google and Yahoo. Read what people like Steve Souders or John Resig have to say about web performance. There is also a great collection of web performance related blogs on Planet Performance.

Let me know what your top problems are and whether you would add or remove anything from my list.

Related reading:

  1. IE Compatibility View: How to identify performance problems between IE versions A client of ours recently contacted me with the question:...
  2. 6 Steps to identify the major web site performance problems on pages like masters.com Remark: The analysis in this blog was done on masters.com...
  3. Hands-On Guide: Verifying FIFA World Cup Web Site against Performance Best Practices Whether you call it Football, Futbol, Fussball, Futebol, Calcio or...
  4. How better Caching helps Frankfurt’s Airport Website to handle additional load caused by the Volcano Along with so many others I am stranded in Europe...
  5. Best Practices on JavaScript and AJAX Performance JavaScript can save your day or it can cause you...

More Stories By Andreas Grabner

Andreas Grabner has been helping companies improve their application performance for 15+ years. He is a regular contributor within Web Performance and DevOps communities and a prolific speaker at user groups and conferences around the world. Reach him at @grabnerandi

@ThingsExpo Stories
SYS-CON Events announced today that SIGMA Corporation will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. uLaser flow inspection device from the Japanese top share to Global Standard! Then, make the best use of data to flip to next page. For more information, visit http://www.sigma-k.co.jp/en/.
SYS-CON Events announced today that Daiya Industry will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Daiya Industry specializes in orthotic support systems and assistive devices with pneumatic artificial muscles in order to contribute to an extended healthy life expectancy. For more information, please visit https://www.daiyak...
SYS-CON Events announced today that B2Cloud will exhibit at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. B2Cloud specializes in IoT devices for preventive and predictive maintenance in any kind of equipment retrieving data like Energy consumption, working time, temperature, humidity, pressure, etc.
SYS-CON Events announced today that Massive Networks, that helps your business operate seamlessly with fast, reliable, and secure internet and network solutions, has been named "Exhibitor" of SYS-CON's 21st International Cloud Expo ®, which will take place on Oct 31 - Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. As a premier telecommunications provider, Massive Networks is headquartered out of Louisville, Colorado. With years of experience under their belt, their team of...
SYS-CON Events announced today that NetApp has been named “Bronze Sponsor” of SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. NetApp is the data authority for hybrid cloud. NetApp provides a full range of hybrid cloud data services that simplify management of applications and data across cloud and on-premises environments to accelerate digital transformation. Together with their partners, NetApp em...
SYS-CON Events announced today that Interface Corporation will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Interface Corporation is a company developing, manufacturing and marketing high quality and wide variety of industrial computers and interface modules such as PCIs and PCI express. For more information, visit http://www.i...
SYS-CON Events announced today that Mobile Create USA will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Mobile Create USA Inc. is an MVNO-based business model that uses portable communication devices and cellular-based infrastructure in the development, sales, operation and mobile communications systems incorporating GPS capabi...
SYS-CON Events announced today that Nihon Micron will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Nihon Micron Co., Ltd. strives for technological innovation to establish high-density, high-precision processing technology for providing printed circuit board and metal mount RFID tags used for communication devices. For more inf...
SYS-CON Events announced today that N3N will exhibit at SYS-CON's @ThingsExpo, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. N3N’s solutions increase the effectiveness of operations and control centers, increase the value of IoT investments, and facilitate real-time operational decision making. N3N enables operations teams with a four dimensional digital “big board” that consolidates real-time live video feeds alongside IoT sensor data a...
SYS-CON Events announced today that Suzuki Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Suzuki Inc. is a semiconductor-related business, including sales of consuming parts, parts repair, and maintenance for semiconductor manufacturing machines, etc. It is also a health care business providing experimental research for...
While some developers care passionately about how data centers and clouds are architected, for most, it is only the end result that matters. To the majority of companies, technology exists to solve a business problem, and only delivers value when it is solving that problem. 2017 brings the mainstream adoption of containers for production workloads. In his session at 21st Cloud Expo, Ben McCormack, VP of Operations at Evernote, will discuss how data centers of the future will be managed, how th...
SYS-CON Events announced today that Ryobi Systems will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Ryobi Systems Co., Ltd., as an information service company, specialized in business support for local governments and medical industry. We are challenging to achive the precision farming with AI. For more information, visit http:...
SYS-CON Events announced today that MIRAI Inc. will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. MIRAI Inc. are IT consultants from the public sector whose mission is to solve social issues by technology and innovation and to create a meaningful future for people.
SYS-CON Events announced today that mruby Forum will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. mruby is the lightweight implementation of the Ruby language. We introduce mruby and the mruby IoT framework that enhances development productivity. For more information, visit http://forum.mruby.org/.
SYS-CON Events announced today that Fusic will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Fusic Co. provides mocks as virtual IoT devices. You can customize mocks, and get any amount of data at any time in your test. For more information, visit https://fusic.co.jp/english/.
In his session at @ThingsExpo, Greg Gorman is the Director, IoT Developer Ecosystem, Watson IoT, will provide a short tutorial on Node-RED, a Node.js-based programming tool for wiring together hardware devices, APIs and online services in new and interesting ways. It provides a browser-based editor that makes it easy to wire together flows using a wide range of nodes in the palette that can be deployed to its runtime in a single-click. There is a large library of contributed nodes that help so...
SYS-CON Events announced today that Enroute Lab will exhibit at the Japan External Trade Organization (JETRO) Pavilion at SYS-CON's 21st International Cloud Expo®, which will take place on Oct 31 – Nov 2, 2017, at the Santa Clara Convention Center in Santa Clara, CA. Enroute Lab is an industrial design, research and development company of unmanned robotic vehicle system. For more information, please visit http://elab.co.jp/.
Agile has finally jumped the technology shark, expanding outside the software world. Enterprises are now increasingly adopting Agile practices across their organizations in order to successfully navigate the disruptive waters that threaten to drown them. In our quest for establishing change as a core competency in our organizations, this business-centric notion of Agile is an essential component of Agile Digital Transformation. In the years since the publication of the Agile Manifesto, the conn...
Real IoT production deployments running at scale are collecting sensor data from hundreds / thousands / millions of devices. The goal is to take business-critical actions on the real-time data and find insights from stored datasets. In his session at @ThingsExpo, John Walicki, Watson IoT Developer Advocate at IBM Cloud, will provide a fast-paced developer journey that follows the IoT sensor data from generation, to edge gateway, to edge analytics, to encryption, to the IBM Bluemix cloud, to Wa...
There is huge complexity in implementing a successful digital business that requires efficient on-premise and cloud back-end infrastructure, IT and Internet of Things (IoT) data, analytics, Machine Learning, Artificial Intelligence (AI) and Digital Applications. In the data center alone, there are physical and virtual infrastructures, multiple operating systems, multiple applications and new and emerging business and technological paradigms such as cloud computing and XaaS. And then there are pe...