Andreas Grabner About the Author

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

Best Practices on JavaScript and AJAX Performance

JavaScript can save your day or it can cause you nightmares. JavaScript and XHR (XmlHttpRequest) enable what the industry considers to be Web 2.0 – meaning highly interactive web sites where some application logic is pushed down to the client into the browsers JavaScript engine. As with any application code – regardless of the language and runtime environment – it is easy to not follow Best Practices which ultimately negatively impact the end-user experience with the site.

dynaTrace AJAX Edition has a unique capability to trace all JavaScript execution on the web page. It also traces calls into the Browser DOM (Document Object Model) and is able to capture method arguments and return values. The following illustration shows a JavaScript trace of a script execution in the PurePath view of the dynaTrace AJAX Edition

dynaTrace JavaScript PurePath showing full execution trace including calls into the DOM, method arguments and return values

dynaTrace JavaScript PurePath showing full execution trace including calls into the DOM, method arguments and return values

By getting this level of details on JavaScript execution it is easy to identify slow running JavaScript handlers, custom javascript code, slow access to the DOM and expensive or inefficient calls into 3rd party frameworks such as jQuery

In the Best Practices for JavaScript and AJAX Performance we list all common problems we have seen when working with our AJAX Edition users, people like Steve Souders or John Resig and our commercial customers over the last couple of months. It includes recommendations on how to avoid blocking script blocks, inefficient CSS Selectors with frameworks such as jQuery, reducing DOM manipulations and XHR calls. The latest beta version of the dynaTrace AJAX Edition implements some of these Best Practices to automatically analyze slow running JavaScript code.

Comments

  1. that’s all cool js tip, thank you very much for sharing.

Comments

*


two + = 10