JavaScript & Metaperformance Douglas Crockford Yahoo! Inc.

Slides:



Advertisements
Similar presentations
Implementing Tableau Server in an Enterprise Environment
Advertisements

JavaScript: The Good Parts Part Six: Ajax Performance Douglas Crockford
Javascript Code Quality Check Tools Javascript Code Quality Check Tools JavaScript was originally intended to do small tasks in webpages, but now JavaScript.
HTTP Request/Response Process 1.Enter URL ( in your browser’s address bar. 2.Your browser uses DNS to look up IP address of server.com.
Client side performance in Web based Banking applications Divakar Prabhu Infosys Limited (NASDAQ: INFY)
Rowan County Public Library. What Is a Web Browser? A web browser is a software application that allows you to browse the internet, provided that you.
FlexJS™ Flex™ For JavaScript Seattle Web App Developers Meetup January 15, 2015 Alex Harui Apache FlexJS, Apache Flex, FlexJS and Flex are are either registered.
WebFOCUS Active Technologies: Continuing Innovation
Online Performance Auditing Using Hot Optimizations Without Getting Burned Jeremy Lau (UCSD, IBM) Matthew Arnold (IBM) Michael Hind (IBM) Brad Calder (UCSD)
Google Web Toolkit - Gufran Mohammed. Google Web Toolkit (GWT) is an open source Java software development framework that makes writing AJAX applications.
Copyright © 2002 Pearson Education, Inc. Slide 4-1 Choosing the Hardware for an E-commerce Site  Hardware platform  Refers to all the underlying computing.
27-Jun-15 Profiling code, Timing Methods. Optimization Optimization is the process of making a program as fast (or as small) as possible Here’s what the.
SCRIPTING LANGUAGE. The first interactive shells were developed in the 1960s to enable remote operation of the first time-sharing systems, and these,
30-Jun-15 Profiling. Optimization Optimization is the process of making a program as fast (or as small) as possible Here’s what the experts say about.
Development of mobile applications using PhoneGap and HTML 5
1 1 Profiling & Optimization David Geldreich (DREAM)
HTML and Designing Web Pages. u At its creation, the web was all about –Web pages were clumsily assembled –Web sites were accumulations of hyperlinked.
JavaScript CMPT 281. Outline Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages.
Basic Web Design. Technology is a tool  FIRST, understand how people actually interact with each other and with the information in their lives, in all.
ITM352 PHP and Dynamic Web Pages: Server Side Processing.
Parts of a Computer Why Use Binary Numbers? Source Code - Assembly - Machine Code.
Language Systems Chapter FourModern Programming Languages 1.
CMSC 202 Computer Science II for Majors Object-Oriented Programming.
Implementation - Part 2 CPS 181s March 18, Pieces of the Site-building Puzzle Page 180, figure 4.1.
Clement Allen, PhD Florida A&M University SUMMER 2006.
1 ENERGY 211 / CME 211 Lecture 26 November 19, 2008.
Java Tutorial Ethan New York University.
Web Design (1) Terminology. Coding ‘languages’ (1) HTML - Hypertext Markup Language - describes the content of a web page CSS - Cascading Style Sheets.
Chapter 2 – Software Processes Lecture 2 1Chapter 2 Software Processes.
Issues Autonomic operation (fault tolerance) Minimize interference to applications Hardware support for new operating systems Resource management (global.
Module 4 Part 2 Introduction To Software Development : Programming & Languages Introduction To Software Development : Programming & Languages.
CS 3500 L Performance l Code Complete 2 – Chapters 25/26 and Chapter 7 of K&P l Compare today to 44 years ago – The Burroughs B1700 – circa 1974.
CSc 453 Compilers & Systems Software Saumya Debray The University of Arizona Tucson, AZ
GeoGebra on mobile devices GeoGebraMobile, the JavaScript version of GeoGebra. Gabor Ancsin (this man =>)
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
Virtual Application Profiler (VAPP) Problem – Increasing hardware complexity – Programmers need to understand interactions between architecture and their.
Dispatching Java agents to user for data extraction from third party web sites Alex Roque F.I.U. HPDRC.
Browser Wars By: Jesse Arredondo
Presented by Luke St Jack!.  Web browsers a type of application that are capable of translating html data from websites and other sources into a readable.
Introduction to JavaScript Fort Collins, CO Copyright © XTR Systems, LLC Introduction to JavaScript Programming Instructor: Joseph DiVerdi, Ph.D., MBA.
Web Browsing *TAKE NOTES*. Millions of people browse the Web every day for research, shopping, job duties and entertainment. Installing a web browser.
Unit-IV - Flash Player - Flex framework - MXML introduction - Action script introduction - Working with Action script - Flex data binding - Common UI components.
Accelerating PHP Applications Ilia Alshanetsky O’Reilly Open Source Convention August 3rd, 2005.
The Process From bare bones to finished product. The Steps Programming Debugging Performance Tuning Optimization.
Chapter 2 – Software Processes Lecture 2 1Chapter 2 Software Processes.
Lesson 1 1 LESSON 1 l Background information l Introduction to Java Introduction and a Taste of Java.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Javascript ECMA Script. Scripting Languages Executed by an interpreter A program that reads & runs commands;advanced enough to be a lang Parsed when.
Flux & React Web Application Development Mark Repka, Rich McNeary, Steve Mueller.
Google Web Toolkit for Mobile Applications Development INGENUITY AT ITS BEST……………….
Introduction to Programming 1 1 2Introduction to Java.
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.
Lesson 2: First Java Programs. 2.1 Why Java? Java is one of the most popular programming languages in the world. Java is a modern object-oriented programming.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
© 2010 VMware Inc. All rights reserved Why Virtualize? Beng-Hong Lim, VMware, Inc.
Technologies For Creating Rich Internet Applications Presenter's name
Applications Active Web Documents Active Web Documents.
Chapter 8 Environments, Alternatives, and Decisions.
SA Capstone Requirements and Design Week 10 SYST Winter 2016
CSCI-235 Micro-Computer Applications
Google Web Toolkit - Gufran Mohammed
Michael Robertson Yuta Takayama Google Closure Tools.
Parallel Programming in Contemporary Programming Languages (Part 2)
Open Source Technologies
DWR: Direct Web Remoting
Chapter 2 – Software Processes
ITI 163: Web, Mobile, and Social Media Design Introduction
CS 4722 Computer Graphics and Multimedia Spring 2018
Running C# in the browser
Presentation transcript:

JavaScript & Metaperformance Douglas Crockford Yahoo! Inc.

SchemeSelfJava JavaScript

Early implementations were optimized to time-to-market. Gradual speed reductions due to 15 years of patching. JavaScript becomes a hugely popular language anyway.

Frenzied Competition Everyone wants to have the fastest JavaScript engine.

Load and Go JavaScript programs are delivered to the execution site in source form. It is compiled and executed immediately. This was to facilitate embedding of JavaScript programs into HTML... Which is now considered a bad practice. Interference with minification, compression, caching. Promotion of XSS injection.

No time for Optimizing ECMAScript programs are expected to start execution instantly. ECMAScript does not specify an executable format or a virtual machine. There is a tradeoff between off-line optimization and portability. Portability is the web’s most valuable feature.

An Interlude.

Remember Java? Java specified a Virtual Machine and an executable format. Java applets were to rule the world in the late 20th Century. The biggest failure in the history of software development. Failed security model. Lack of portability (write once, debug everywhere). Awful UI toolkit. Horrendous startup times (classloading). These things were not a big problem in servers.

End of Interlude.

There does not exist an executable format that is Secure Highly optimizable Highly portable

Optimize as you go. Self.

How fast are the new engines? That is complicated.

Lies, Damn Lies, and Benchmarks Benchmark Bias Promote patterns that engine implementers want to implement. Promote patterns that resemble benchmarks. JSMeter [ en-us/projects/jsmeter/] The benchmarks are not representative of real programs.

The engine makers are tuning to the benchmarks, struggling to produce the best numbers. Performance without measurement is meaningless. They don’t know what else to do.

Life on the Web Web developers have a difficult time with the browser. Desire to produce applications that are highly responsive. Browser platform contains some deep inefficiencies. Little visibility into the causes of performance degradation.

The DOM Bottleneck If the JS engine were infinitely fast, most web applications would run about the same speed. Browsers spend most of their time in layout, painting, marshalling, styling, IO, etc. The benefit of faster JS engines is the enabling of new kinds of applications.

Life on the Web Out of frustration, many developers are dedicated to optimizing their JavaScript code, even though it is not effective.

An Interlude

The Drunk and the Lamppost Story

End of Interlude.

Premature optimization is the root of all evil. Donald E. Knuth

Life on the Web Web Developers believe that they must optimize prematurely because they will not be given a chance to do it later. To choose between two language features, put each in a loop and run 1000 times. Always use the winner. Even if The difference was not significant. The race is likely to go the other way in future versions. This results in code that is more difficult to read or maintain.

They are trying to do the right thing. They think themselves responsible and heroic.

This behavior of developers interacts badly with performance benchmarks. Benchmarks Engine performance Programming style

This behavior of developers interacts badly with performance benchmarks. Benchmarks Engine performance Programming style The benchmarks are discouraging good programming practices.

An Interlude. Who am I to say what are good coding practices?

I discovered that JavaScript has good parts. I developed programming patterns that make use of the good parts while avoiding the bad parts. I developed a code quality tool, JSLint, to help developers use the good parts more effectively.

End of Interlude.

I am concerned that the benchmarks are having the unintended consequence of worsening the language and its usage.

The benchmarks do not reflect the characteristics of good programs.

So…

I designed a new benchmark. The benchmark is JSLint, measuring how long it takes to analyze jslint.js. It demonstrates real application behaviors that are not exercised in the other benchmarks, especially prototypal and functional patterns. It is a test only of JavaScript performance. It does not measure any of the other aspects of browser performance.

Browser Seconds Chrome IE Opera Safari Firefox IE 10 preview 0.56 Chrome 13 canary 0.54 JavaScript Performance (smaller is better)

Thank you and good night.