Web Performance Optimization Boban Stojanovski (Senior Front End Developer at Solaborate) Think Fast by default.

Slides:



Advertisements
Similar presentations
Optimizing Websites with YSlow Tom Lianza Co-Founder Wishlisting.com Tom Lianza Co-Founder Wishlisting.com.
Advertisements

High Performance Web Sites Essential Knowledge for Frontend Engineers
CS193H: High Performance Web Sites Lecture 1: Introduction Steve Souders Google
High Performance Web Sites Essential Knowledge for Frontend Engineers
CS193H: High Performance Web Sites Lecture 12: Rule 8 – Make JavaScript and CSS External Steve Souders Google
Web Performance Meetup 1 Web Performance 101 Jeremy
Web Performance Meetup 1 Web Performance Toolbelt Jeremy
Stevesouders.com/docs/velocity-wpo pptx Disclaimer: This content does not necessarily reflect the opinions of my employer.
Web Site Performance What makes web sites slow? Back end Front end Tools for measuring performance Firebug / YSlow Visual Studio Test Edition W3.org html.
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Iframes & Images Using HTML.
Improving Web Site Performance and Scalability While Saving Money Robert Boedigheimer ∙ Web Application
1 HTML Standards & Compliance. 2 Minimum Required HTML tags: (must go in this order!)
Client side performance in Web based Banking applications Divakar Prabhu Infosys Limited (NASDAQ: INFY)
The Web Warrior Guide to Web Design Technologies
How does it work?. What is the Internet? Computer Protocols TCP/IP: Transmission Control Protocol/Internet Protocol HTTP: Hypertext Transfer Protocol.
Web Page Behavior IS 373—Web Standards Todd Will.
Analysis and Performance Information Systems 337 Prof. Harry Plantinga.
High Performance Websites (Based on Steve Souder’s lecture) By Bhoomi Patel.
Responsive Web Design Design websites so that they can adapt to different devices seamlessly. Image by Muhammed RafizeldiMuhammed Rafizeldi.
Philly.NET Hands-On jQuery + Plug-ins Bill Wolff, Rob Keiser.
Mark Phillip markphillip.com 200s, 304s, Expires Headers, HTTP Compression, And You.
CSS (Cascading Style Sheets): How the web is styled Create Rules that specify how the content of an HTML Element should appear. CSS controls how your web.
Performance, SEO, Accessibility Ivan Zhekov Telerik Corporation
DHTML - Introduction Introduction to DHTML, the DOM, JS review.
Javascript and the Web Whys and Hows of Javascript.
JavaScript & jQuery the missing manual Chapter 11
CS346 - Javascript 1, 21 Module 1 Introduction to JavaScript CS346.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
Keeping Front End Dependencies Under Control Rachel Lehman Technical Team at Interfolio, -
CSS Sprites. What are sprites? In the early days of video games, memory for graphics was very low. So to make things load quickly and make graphics look.
Chapter 4 Adding Images. Chapter 4 Lessons Introduction 1.Insert and align images 2.Enhance an image and use alternate text 3.Insert a background image.
Lesson13. JavaScript JavaScript is an interpreted language, designed to function within a web browser. It can also be used on the server.
Unit 2, cont. September 12 More HTML. Attributes Some tags are modifiable with attributes This changes the way a tag behaves Modifying a tag requires.
DHTML - Introduction Chapter Introduction to DHTML, the DOM, JS review.
Page Speed Bryan McQuade Richard Rabbat. Outline  What is Page Speed?  Inception of Page Speed  Cool features  Identify unused JavaScript and CSS.
Optimizing Web Sites Lee Sutherland. The Key Point In IA, ‘optimization’ refers to minimizing complexity to achieve faster download times Speed is an.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
Copyright (c) 2004 Prentice-Hall. All rights reserved. 1 Committed to Shaping the Next Generation of IT Experts. Adding Graphical Elements Essentials for.
Web Design (1) Terminology. Coding ‘languages’ (1) HTML - Hypertext Markup Language - describes the content of a web page CSS - Cascading Style Sheets.
Cs332a_chapt10.ppt CS332A Advanced HTML Programming DHTML Dynamic Hypertext Markup Language A term describing a series of technologies Not a stand-a-lone.
JQuery Introduction © Copyright 2014, Fred McClurg All Rights Reserved.
AMD and RequireJS Splitting JavaScript Code into Dependent Modules Software University Technical Trainers SoftUni Team.
PERFORMANCE ENHANCEMENT IN ASP.NET By Hassan Tariq Session #1.
Web Graphics. Web graphics Bandwidth is king Graphics must load quickly Graphics must be optimized All other components except for text, gif and jpg are.
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
Restricted © Siemens AG All rights reserved A Developer’s Insights Into Performance Optimizations for Mobile Web Apps CT DC AA EM LP2 | June 2015.
Lecture 15. A Very Brief Introduction to HTML and XHTML, part IV Instructor: Jie Yang Department of Computer Science University of Massachusetts Lowell.
WRA 210: 10/7/13 IMAGES. TODAY’S AGENDA Reminder about Module 8 - test your links!Module 8 Overview of hierarchies, naming How images work on the web.
INTRODUCTION JavaScript can make websites more interactive, interesting, and user-friendly.
Bundles, Minification Andres Käver, IT Kolledž
IE Developer Tools Jonathan Seitel Program Manager.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Website: Contact:
HTML5 and CSS3 Illustrated Unit F: Inserting and Working with Images.
#SummitNow The Share Widget Library 13 th November 2013 Dave Draper
Site Speed: The Ultimate UX Feature… for SEO. A case study on how to increase search engine crawling and online conversion Jonathon Colman In-House SEO.
Technical SEO tips for Web Developers Richa Bhatia Singsys Pte. Ltd.
Enhance Your Page Load Speed And Improve Traffic.
Computer Basics Introduction CIS 109 Columbia College.
Pragmatic Drupal Development John Fiala Developer.
JavaScript: Good Practices
Inserting and Working with Images
Time is the enemy: Ten Core Lessons for Achieving Peak
4. Javascript Pemrograman Web I Program Studi Teknik Informatika
Tips for Website Speed Optimization
Hints and tips for faster web apps
DEBUGGING CS2110.
High Performance Mobile
Yale Digital Conference 2019
Presentation transcript:

Web Performance Optimization Boban Stojanovski (Senior Front End Developer at Solaborate) Think Fast by default

Change of Mindset Make performance a priority Put performance in requirements documentation Make it part of your development routine Developers have great machines, what about the rest of the world

Golden Rule 80-90% of the end-user response time is spent on the frontend -- Steve Souders The optimizations of frontend is the web developers job

Network load time waterfall

Performance matters Performance matters to the end user Perceived speed vs. Actual Speed (Visual completeness) Many studies show user are more interested in Perceived speed Fast page load time builds trust in your website.

3 Critical Limits 0.1 Second – 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. 1.0 Second – limit for the users flow of thought to remain uninterrupted 10 Seconds = limit for keeping the user attention on the screen

Performance means money

How to approach optimization There are 2 things to take into consideration : Measurement and Perception There has to be a balance between the two Efficiency – Speed, Memory … other resources Noncritical vs Critical optimization paths Benchmark and quantify results Make users studies, let them judge the experience (science fiction for most of us)

Quotes “Premature optimization is the root of all evil” - Donald Knuth

Quotes “Programmers waste enormous amounts of time … worrying about the speed of noncritical parts of their apps… We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%. A good programmer will not be lulled into complacency by such reasoning, he will be wise to look carefully at the critical code; but only after that code has been identified” - Donald Knuth “Bottlenecks occur in surprising places, so don't try to second guess and put in a speed hack until you have proven that's where the bottleneck is.” - Rob Pike “The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson

Quotes “Optimizing non-critical code paths is the root of all evil.” – Donald Knuth Other way to put it “Immature Optimization is the root of all evil”

Promised Refactor Just do it …. We will refactor (fix it) later Be responsible talk to your boss about total cost Nice way to fix obvious mistakes … have code reviews

YSlow YSlow analyzes web pages and suggests ways to improve their performance based on a set of rules for high performance web pages.

YSlow Rules Minimize HTTP Requests Use a Content Delivery Network Add an Expires Header Gzip Components Put Stylesheets at the Top Put Scripts at the Bottom Make JavaScript and CSS External Do Not Scale Images in HTML Minify JavaScript

YSlow Rules Reduce DNS Lookups Remove Duplicate Scripts Configure Etags Make AJAX Cacheable Post-load Components Pre-load Components Reduce Cookie Size Use Cookie-free Domains for Components Empty image src Reduce the Number of DOM Elements

Images Image optimization Sprites

ElementsSpritesInlining High number of extra HTTP requests (one for each image) Moderate number of extra HTTP requests (one for a CSS file, and one for each sprite) Low number of extra HTTP requests (one for a CSS file) Small image file size; images save space when packed together Larger page size due to base-64 encoding Compatible with all browsersCompatible with all current- generation browsers Only compatible with latest versions of WebKit, Mozilla browsers, Internet Explorer (IE8+)

Image file types PNG : for transparency and more color PNG-24 for less color PNG-8 JPEG : Lot’s of color (photo like),Easy to change quality,No Transparency GIF : Very heavy. Most animations can be replaced with CSS3

Quiz What file type would you use for the background of these buttons? PNG-8,PNG-24,GIF,JPEG?

Bundling and Minification

Levels of Minification Level 1: Removal of white space and comments Level 2: Remove extra semicolons and curly braces Level 3: Local variable name shortening Level 4: Removal of unreachable or unused code Level 5: Global shortcuts and shortening of function names

856 bytes 253 bytes

Popular minified libraies

AMD vs Bundling Asynchronous Module Definition (AMD) specifies a mechanism for defining modules such that the module and its dependencies can be asynchronously loaded. This is particularly well suited for the browser environment where synchronous loading of modules incurs performance, usability, debugging, and cross-domain access problems. Most popular AMD library is “require.js” -

RequireJS define( id?, dependencies?, factory)

Other things Only send trough that witch is necessary Compress your JSON response, shorten the names of props and remove null(empty) fields Write better JS Write your own plugins

Common JS mistakes

Solaborate optimization

Благодарам за вниманието Q&AQ&A