Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering The Faster Web with PHP, MySQL, and JavaScript

You're reading from   Mastering The Faster Web with PHP, MySQL, and JavaScript Develop state-of-the-art web applications using the latest web technologies

Arrow left icon
Product type Paperback
Published in Jun 2018
Publisher Packt
ISBN-13 9781788392211
Length 278 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Andrew Caya Andrew Caya
Author Profile Icon Andrew Caya
Andrew Caya
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Title Page
Copyright and Credits
Dedication
Packt Upsell
Foreword
Contributors
Preface
1. Faster Web – Getting Started FREE CHAPTER 2. Continuous Profiling and Monitoring 3. Harnessing the Power of PHP 7 Data Structures and Functions 4. Envisioning the Future with Asynchronous PHP 5. Measuring and Optimizing Database Performance 6. Querying a Modern SQL Database Efficiently 7. JavaScript and Danger-Driven Development 8. Functional JavaScript 9. Boosting a Web Server's Performance 10. Going Beyond Performance 1. Other Books You May Enjoy Index

Structuring and loading a JavaScript application


When thinking of how to structure and load a JavaScript application, it is important to remember certain important principles.

Minimizing costly operations

The costliest operations to do in JavaScript are:

  • Requesting a resource through network I/O
  • Display repainting, also known as redrawing, of the web page due to dynamic content changes such as making an element visible
  • Reflowing, which can be caused by a window resize
  • A DOM manipulation or dynamic change to the page’s styling

Obviously, the bottom line is that all these operations should be kept to a bare minimum in order to preserve good performance in general. When working on a script that is executing too slowly, these are the most important elements to look for with Google Chrome's Timeline tool, which can be accessed through Chrome’s Developer tools, as mentioned in Chapter 1Faster Web – Getting Started, of this book.

Cleaning up, minifying, and compressing resources

Of course, excluding unused...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime
Banner background image