SlideShare a Scribd company logo
Measuring Performance,
  JavaScript Games,
and Distributed Testing
                  John Resig
 http://ejohn.org - http://twitter.com/jeresig
Measuring
Performance
Analyzing Performance
    Optimizing performance is a huge
✦
    concern: Faster code = happy users!
    Measure execution time
✦

    Loop the code a few times
✦

    Measure the difference:
✦
    ✦ (new Date).getTime();
Stack Profiling
    jQuery Stack Profiler
✦

    Look for problematic methods and plugins
✦

    http://ejohn.org/blog/deep-profiling-
✦
    jquery-apps/

Recommended for you

High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010

This document summarizes Nicholas C. Zakas' presentation on high performance JavaScript. It discusses how the browser UI thread handles both UI updates and JavaScript execution sequentially. Long running JavaScript can cause unresponsive UIs. Techniques to ensure responsive UIs include limiting JavaScript execution time, using timers or web workers to break up processing, reducing repaints and reflows, and grouping style changes. Hardware acceleration and optimizing JavaScript engines have improved performance but responsive UIs still require discipline.

wdusajavascriptperformance
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5

20100807 OSC Nagoya での講演資料 # スライドのみで見やすいよう若干整理 P5〜 Agenda P17〜 "HTML5" って何? P56〜 HTML5 の範囲は? P67〜 ブラウザのサポートは? P94〜 IE6 はどうするの? P118〜 使用上の注意 P147〜 便利なツールは? P152〜 One Point Q&A P186〜 追加資料

whatwghtml5webgl
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications

The document discusses techniques for optimizing JavaScript and AJAX performance. It recommends planning for performance from the start, measuring performance during development, reducing unnecessary code, optimizing assets, and handling long-running processes by breaking work into chunks. Specific tips include minimizing HTTP requests, leveraging caching, optimizing regular expressions, and using innerHTML for document modifications instead of DOM methods.

Performance, Games, and Distributed Testing in JavaScript
Accuracy of
  JavaScript Time
We’re measuring the performance of
 JavaScript from within JavaScript!


  http://ejohn.org/blog/accuracy-of-javascript-time/
Performance, Games, and Distributed Testing in JavaScript
Performance, Games, and Distributed Testing in JavaScript

Recommended for you

Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries

This document discusses using JavaScript libraries to write unobtrusive scripts. It begins with a brief history of JavaScript development and introduces concepts like unobtrusive scripting and progressive enhancement. It then provides examples of basic unobtrusive scripts and discusses challenges like cross-browser event handling. The bulk of the document focuses on JavaScript libraries and their benefits, listing common library features and some of the most popular libraries like jQuery. It concludes with a specific example using Yahoo's YUI library to add AJAX functionality to a login form.

webstock08webstockunobtrusivescripting
Unit and functional testing with Siesta
Unit and functional testing with SiestaUnit and functional testing with Siesta
Unit and functional testing with Siesta

This document summarizes a presentation about using the Siesta testing framework for unit and functional testing of JavaScript code. The presentation covers the benefits of Siesta, how to write unit tests, how to do functional testing by simulating user interactions, querying components, and new features of Siesta like an improved UI, auto-scrolling, and code coverage. It also provides examples of unit tests for a user model class and discusses testing views by testing components in isolation and their public API.

unit testingfunctional testinghtml5
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)

In the beginning, progressive enhancement was simple: HTML layered with CSS layered with JavaScript. That worked fine when there were two browsers, but in today's world of multiple devices and multiple browsers, it's time for a progressive enhancement reboot. At the core is the understanding that the web is not print - the same rules don't apply. As developers and consumers we've been fooled into thinking about print paradigms for too long. In this talk, you'll learn just how different the web is and how the evolution of progressive enhancement can lead to better user experiences as well as happier developers and users.

htmlcssprogressive enhancement
Performance, Games, and Distributed Testing in JavaScript
15ms intervals ONLY!

     Error Rate of 50-750%!
Performance Tools
    How can we get good numbers?
✦

    We have to go straight to the source: Use
✦
    the tools the browsers provide.
    Tools:
✦
    ✦ Firebug Profiler
    ✦ Safari Profiler
      ✦ (Part of Safari 4)
    ✦ IE 8 Profiler
Firebug Profiler

Recommended for you

Video.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video PlayerVideo.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video Player

From the 'HTML5 player showcase/How to Build an HTML5 player' given at the Open Video Conference in October 2010.

javascripthtml5 video
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"

1) Web app performance can be improved through code splitting techniques that divide JavaScript bundles into smaller chunks to reduce loading time. 2) Compiler optimizations like tree shaking, constant folding, and dead code elimination can help reduce code size and evaluation time by removing unused code. 3) Code splitting libraries like Webpack allow splitting code at the module or route level to preload important chunks and lazily load others on demand to improve performance.

frameworksjsfwdays
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview

HTML 5 is the latest version of the HTML standard. It includes several new elements and features to improve structure and behavior. Some key changes include new semantic elements like <article>, <aside>, <header>, and <footer>; built-in support for audio and video; the <canvas> element for drawing graphics; and forms with new input types. HTML 5 aims to simplify HTML and separate structure and presentation, making code cleaner and pages more accessible. It is developed jointly by the WHATWG and W3C organizations.

phppaideguaphphtml5
Safari 4 Profiler
IE 8 Profiler
FireUnit
    A simple JavaScript test suite embedded in
✦
    Firebug.
    http://fireunit.org/
✦
FireUnit Profile Data

                                            {
 fireunit.getProfile();                              quot;timequot;: 8.443,
                                                   quot;callsquot;: 611,
                                                   quot;dataquot;:[
                                                   {
                                                      quot;namequot;:quot;makeArray()quot;,
                                                      quot;callsquot;:1,
                                                      quot;percentquot;:23.58,
                                                      quot;ownTimequot;:1.991,
                                                      quot;timequot;:1.991,
                                                      quot;avgTimequot;:1.991,
                                                      quot;minTimequot;:1.991,
                                                      quot;maxTimequot;:1.991,
                                                      quot;fileNamequot;:quot;jquery.js (line 2059)quot;
                                                   },
                                                   // etc.
http://ejohn.org/blog/function-call-profiling/ ]}

Recommended for you

Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications

Introductory overview of testing techniques for web application development. Explains where different testing methods fit in to the software development cycle.

testingjavascriptvenus
Making the HTML5 Video element interactive
Making the HTML5 Video element interactiveMaking the HTML5 Video element interactive
Making the HTML5 Video element interactive

From Streaming Media West Conference Huntington Beach, CA November 2013 C202: HOW TO: Making the HTML5 Video Element Interactive The HTML5 Video element has now become widely used by browsers and supported in a broad set of websites for streaming video content. With some JavaScript and CSS, we can leverage the HTML video element to create highly interactive experiences for the viewer in both traditional and mobile browsing environments. This hands-on session explores the integration of events with the video timeline, creating positioned hotspots with links and dynamic content, and capturing user input. In addition, the session examines supporting mobile platform browsers along with future opportunities with the HTML5 video tag. Get sample code, ideas, and best practices for making the HTML5 video element an engaging interactive experience for your viewers. Speaker: Chuck Hudson, Co-Author, HTML5 Developer's Cookbook

html5videojavascript
Front End Performance
Front End PerformanceFront End Performance
Front End Performance

The document discusses various techniques for improving front-end website performance, including reducing the number of HTTP requests, using content delivery networks and caching, gzip compression, optimizing CSS and JavaScript loading, image optimization, and lazy loading of content not visible initially. Specific techniques mentioned include combining files, setting long cache expiration headers, minifying files, parallelizing downloads, and deferring non-critical JavaScript initialization. The goal is to render an initial version as fast as possible through optimizations that reduce page load time.

drupaldrupalconparistuning
Complexity Analysis
             Analyze complexity rather than raw time
         ✦

             jQuery Call Count Profiler (uses FireUnit)
         ✦

             Method                        Calls           Big-O
.addClass(quot;testquot;);                 542             6n
.addClass(quot;testquot;);                 592             6n
.removeClass(quot;testquot;);              754             8n
.removeClass(quot;testquot;);              610             6n
.css(quot;colorquot;, quot;redquot;);              495             5n
.css({color: quot;redquot;, border: quot;1px   887             9n
solid redquot;});
.remove();                         23772           2n+n2
.append(quot;<p>test</p>quot;);            307             3n
Complexity Analysis
               Reducing call count helps to reduce
           ✦
               complexity
               Results for 1.3.3:
           ✦

                        Method                        Calls        Big-O

              .remove();                        298           3n

              .html(quot;<p>test</p>quot;); 507                       5n

              .empty();                         200           2n



http://ejohn.org/blog/function-call-profiling/
Why JavaScript
Games Are HARD
    to Build
Browser-Based Games
    No installation required
✦

    (Will be able to play at work!)
✦

Recommended for you

Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija

An intro to nightwatch(a tool to create and run functional tests, e2e tests using selenium in the background) and examples of cases, also how to integrate nightwatch to a Continous Integration tool

testingjavascriptnightwatch
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins

This document discusses jQuery UI and plugins. It provides an overview of jQuery UI classes that can be used to style elements. It also demonstrates several common jQuery UI widgets like buttons, accordions, dialogs, and tabs. The document discusses jQuery UI effects for animations and transitions. It provides tips for identifying good plugins based on aspects like their API, documentation, support, and community. Overall, the document is an introduction to using jQuery UI and evaluating jQuery plugins.

pluginsthemerollercss framework
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance

This document discusses optimizing Meetup's performance by reducing page load times. It recommends reducing JavaScript, image, DOM, and CSS files. Specific techniques include externalizing and concatenating JavaScript, lazy loading images and scripts, minimizing DOM elements, writing efficient CSS selectors, and profiling code to optimize loops and DOM manipulation. Reducing page weight through these techniques can improve the user experience by speeding up load times and drop in member activity.

Why not Flash?
    JavaScript works everywhere
✦
    ✦ Desktop
    ✦ iPhone / Mobile Device
    ✦ Wii
    ✦ OLPC

    JavaScript is an open technology
✦
Goals of a game
    Should be Multiplayer
✦

    Can’t be casually cheated
✦

    Work well everywhere
✦

    Addictive
✦
Why Multiplayer?
    Incredibly addictive
✦
    ✦ No longer “alone”
    ✦ Enticed to continue playing
3 Styles of Games
    Strategy
✦

    Intelligence
✦

    Accuracy
✦

Recommended for you

Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization

80% of the time it takes for a web page to load is on the client side. Using all the tips in this presentation should cut 25% to 50% off the load time of optimized page requests. Drupal (6 or 7) can be used to, fairly easily, implement a whole bunch of these “front-end performance” upgrades, and knock a ton of errors off of the Yahoo! and Google speed-checker tools validation checklists. Get firebug first.

drupalpagespeed upgradespressflow
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testing

This document discusses the importance of unit testing JavaScript code. It provides reasons for testing JavaScript, such as avoiding bugs when refactoring code or introducing errors. The document discusses how to write testable JavaScript by separating business logic from views. It also recommends choosing JavaScript unit testing tools like Jasmine and Siesta, and integrating tests into continuous integration processes to run automatically on commits. Functional testing tools like Selenium are also mentioned for testing user interactions across browsers.

unit testingsoftware testingjavascript
The JSON Saga
The JSON SagaThe JSON Saga
The JSON Saga

The document discusses the origins and development of JSON (JavaScript Object Notation). It describes how Douglas Crockford discovered JSON in 2001 and published the first JSON specification in 2002. It outlines some of the key events in the early adoption of JSON, including its use for browser/server communication and as an alternative to XML.

jsoncrockford
Strategy Games
    Require a lot of time to think
✦

    Generally last over a couple hours or days
✦

    Replayability
✦

    Hard to cheat
✦
WarFish




        http://warfish.net/
    ✦
Nile Online




      http://www.playnileonline.com/
  ✦
Strategy Games
    Very server-side heavy
✦
    ✦ Most logic hidden from the user

    Hard to cheat
✦
    ✦ Casual cheaters can’t change values
    ✦ Dedicated cheaters have to write full AI

Recommended for you

The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom

- The original vision of the World Wide Web was as a hyperlinked document retrieval system, not for presentation, sessions, or interactivity. If it had stayed true to this vision, modern sites like Yahoo would not exist. - Browser wars in the 1990s led to proprietary technologies that frustrated developers. The introduction of JavaScript in 1995 allowed for dynamic and interactive web pages. - By the 2000s, Microsoft's Internet Explorer dominated the browser market, bringing some stability through standards like DOM and DHTML. However, cross-browser differences still posed challenges for developers.

crockfordjavascript
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performance

The document discusses optimizing performance for Ajax applications. It recommends: - Keeping client-side code light by only requesting necessary data from the server via JSON messages. - Avoiding unnecessary DOM touches and reflows which are computationally expensive. - Measuring performance before and after optimizations to validate improvements rather than relying on intuition. - Optimizing algorithms and avoiding unnecessary work rather than prematurely optimizing without evidence of need.

javascriptcrockfordajax
Douglas Crockford - Programming Style and Your Brain
Douglas Crockford - Programming Style and Your BrainDouglas Crockford - Programming Style and Your Brain
Douglas Crockford - Programming Style and Your Brain

Computer programs are the most complicated things that humans make. They must be perfect, which is hard for us because humans are not perfect. Programming is thought to be a “head” activity, but there is a lot of “gut” involved. Indeed, it may be the gut that gives us the insight necessary for solving hard problems. But gut messes us up when it come to matters of style. The systems in our brains that make us vulnerable to advertising and propaganda also influence our programming styles. This talk looks systematically at the development of a programming style that specifically improves the reliability of programs. The examples are given in JavaScript, a language with an uncommonly large number of bad parts, but the principles are applicable to all programming languages.

programmingjavascriptweb design and development
Intelligence Games
    Player’s intelligence/knowledge challenged
✦

    Games could be quick or slow-paced
✦

    Easy to cheat
✦
    ✦ Casual cheaters can open dictionary /
      encyclopedia for answers
Word Twist




      http://wordtwist.org/
  ✦
Babble




      http://playbabble.com/
  ✦
Iron Sudoku




      http://ironsudoku.com/
  ✦

Recommended for you

Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers

This document summarizes upcoming improvements and new features in web browsers, including Firefox 3.1, Safari 4, Internet Explorer 8, Opera 10, and Google Chrome. Many of the browsers are focusing on better JavaScript performance through new engines like TraceMonkey and V8. New features include process per tab, postMessage for cross-domain communication, HTML5 drag and drop, and the Canvas element for offloading rendering to the client. Overall the browsers are aiming to improve speed, compatibility, and the user experience through these new features and technologies.

javascriptdombrowsers
Douglas Crockford - Ajax Security
Douglas Crockford - Ajax SecurityDouglas Crockford - Ajax Security
Douglas Crockford - Ajax Security

<p>Security design is an important, but often neglected, component of system design. In this session, Douglas Crockford, creator of Javascript Object Notation, will outline the security issues that must be considered in the architecture of Ajax applications.</p> <p>The design of the browser did not anticipate the needs of multiparty applications. The browser’s security model frustrates useful activities and allows some very dangerous activities. This talk will look at the small set of options before us that will determine the future of the Web.<br /> During this session, attendees will:</p> <ul> <li>Learn why effective security is an inherent feature of good design;</li> <li>Experience a real-time demo of a Ajax client/server system based on sound security principles</li> <li>See how to apply secure design to rich web applications.</li> </ul>

wds08javascriptsecurity
Json
JsonJson
Json

JSON is a lightweight data-interchange format that is easy for humans to read and write and for machines to parse and generate. It is built on two structures: a collection of name/value pairs and an ordered list of values. JSON is widely used to transmit data between a server and web application, and has largely become the default format for asynchronous browser/server communication. While easy for machines to parse and generate, it is also readable by humans.

jsonjavascriptweb development
Speed/Accuracy Games
    Require low latency
✦

    Fast-paced and addictive
✦

    JavaScript completely fails
✦
    ✦ Garbage Collection cycles freeze the
      browser
    None, or few, Accuracy-centric JavaScript
✦
    games
    Experienced coders can easily cheat
✦
    ✦ (A bot to hit the keys at the right time)
Guitar Hero




    http://ejohn.org/apps/hero/
Guitar Hero
    Heavily dependent upon accuracy
✦
    ✦ (Hit the right notes at the right time)

    Garbage collection cycles absolutely kill
✦
    the game
    Rendering the play area is also difficult
✦
    ✦ And impossible in all browsers.
    ✦ (Use HTML 5 Canvas Element)
Failures on All Ends
    Strategy: Slow, secret server-side code
✦

    Intelligence: Easily cheatable
✦

    Accuracy: Too hard to implement
✦

    Optimal solution would be a combination
✦
    of the above.
    JavaScript games can’t be like other games,
✦
    have to be unique.

Recommended for you

OOP in JavaScript
OOP in JavaScriptOOP in JavaScript
OOP in JavaScript

This document discusses object-oriented programming concepts in JavaScript, including encapsulation, inheritance, and polymorphism. It provides examples of implementing encapsulation with private and public properties and methods. Inheritance is demonstrated through extending classes. Polymorphism is shown through functions that can take on different meanings based on context. JSON and closures are also mentioned.

Good Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas CrockfordGood Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas Crockford
ajaxworld-2008ajaxworld-2008ajaxworld-2008
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript

The document discusses different approaches to object-oriented programming in JavaScript, including classical and prototypal inheritance, constructor functions, and the prototype property. It explains how prototypal inheritance works by linking objects together through their internal prototype properties. Constructor functions and the new operator allow simulating classical inheritance by establishing prototype links. Various design patterns are also covered, such as public/privileged methods, singletons, modules, and parasitic inheritance.

What can make a fun game?
    Quick play
✦

    Points
✦

    High Scores
✦

    Head-to-head competition
✦
Wordsplay




    Real-time Boggle
✦

    Head-to-head with other players
✦

          http://www.wordsplay.net/
Tringo




    Tetris + Bingo (based on a Second Life
✦
    game)
                              http://ejohn.org/tringo/
DeepLeap



    Fast-paced Scrabble-like game
✦

    Speed + Intelligence + Strategy
✦




                                 http://deepleap.org/

Recommended for you

Advanced JavaScript Concepts
Advanced JavaScript ConceptsAdvanced JavaScript Concepts
Advanced JavaScript Concepts

Topics covered: Closure, Callback, Module Pattern, Cascading, Curry, Inheritance, Pseudo Classical, Prototype

javascript
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application Architecture

\n\nThe document discusses scalable JavaScript application architecture. It advocates for a modular approach where each component (module) has a limited, well-defined purpose and interface. Modules are loosely coupled by communicating through a central sandbox interface rather than directly referencing each other. The core application manages modules by registering, starting, and stopping them. It also handles errors and enables extension points. This architecture aims to build flexible, maintainable applications that can evolve over time.

oopjavascriptarchitecture
The DOM is a Mess @ Yahoo
The DOM is a Mess @ YahooThe DOM is a Mess @ Yahoo
The DOM is a Mess @ Yahoo

The document discusses the messy and buggy state of the DOM across browsers and strategies for writing cross-browser JavaScript code. It notes that nearly every DOM method has bugs or inconsistencies in some browsers. It then covers strategies like feature detection, graceful fallback for missing features, simulating features via workarounds, monitoring for regressions, and having a robust test suite to prevent regressions in one's own code. The overall message is that the DOM is messy and one needs to "know your enemies" by thoroughly testing code in all target browsers.

domjavascriptyahoo
vs. Cheating
    All words are recorded with exact time
✦
    information
    Game is “played back” on the server to
✦
    verify score integrity using Server-Side JS


    This data can be used to simulate a multi-
✦
    player experience!
DeepLeap
    Works in multiple languages
✦
    ✦ Dictionaries pulled from OpenOffice,
      can build a Spanish version in < 5sec
    Players can challenge each other head-to-
✦
    head
    Score multiplier (carry over from Guitar
✦
    Hero)
Distributed Testing
Choose Your Browsers

Recommended for you

The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language

The document discusses the benefits of exercise for both physical and mental health. Regular exercise can improve cardiovascular health, reduce stress and anxiety, boost mood, and enhance cognitive function. Staying physically active for at least 30 minutes each day is recommended for significant health benefits.

Speed Up Your JavaScript
Speed Up Your JavaScriptSpeed Up Your JavaScript
Speed Up Your JavaScript

Nicholas C. Zakas discusses common JavaScript performance issues and recommendations to address them. He covers scope management, data access, loops, and DOM manipulation. The key points are to minimize scope chain lookups, store frequently accessed data in local variables, optimize loops, avoid reflows from DOM changes, and leverage modern browser optimizations. Overall, the talk provides practical tips to speed up JavaScript code by addressing issues related to scope, data access patterns, loops, and DOM interactions.

nzakasspeedperformance
Performance Improvements In Browsers
Performance Improvements In BrowsersPerformance Improvements In Browsers
Performance Improvements In Browsers

This document summarizes upcoming improvements and new features in web browsers, including Firefox 3.1, Safari 4, Internet Explorer 8, Opera 10, and Google Chrome. Many of the browsers are focusing on better JavaScript performance through new engines like TraceMonkey and V8. New features include process per tab, postMessage for cross-domain communication, HTML5 drag and drop, and the Canvas element for offloading graphics work to the client. Overall the browsers are aiming to improve speed, compatibility, and the user experience through these new implementations and technologies.

javascriptperformancedom
Cost / Benefit




  IE 7     IE 6          FF 3    Safari 3   Opera 9.5
                  Cost          Benefit


         Draw a line in the sand.
Graded Support




   Yahoo Browser Compatibility
Browser Support Grid
           IE      Firefox   Safari   Opera Chrome


Previous   6.0       2.0      3.0      9.5


Current    7.0       3.0      3.2      9.6    1.0


 Next      8.0       3.1      4.0     10.0    2.0

                 jQuery Browser Support
Browser Support Grid
           IE       Firefox   Safari   Opera Chrome


Previous                       3.0      9.5
           6.0        2.0


Current    7.0        3.0      3.2      9.6    1.0


 Next      8.0        3.1      4.0             2.0
                                       10.0

                jQuery 1.3 Browser Support

Recommended for you

jQuery 1.3 and jQuery UI
jQuery 1.3 and jQuery UIjQuery 1.3 and jQuery UI
jQuery 1.3 and jQuery UI

This document summarizes jQuery, a JavaScript library, and its features. It discusses jQuery's selector engine, DOM manipulation abilities, and browser compatibility sniffing. It also describes jQuery UI, a plugin library that adds interactive UI elements like drag and drop. The document outlines jQuery's large plugin ecosystem and testing framework. It concludes with information on profiling jQuery applications for performance optimization.

jquery
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial

- The document is a presentation on Ajax given by Alex Russell that covers what Ajax is, how it works, when it should and should not be used, tools for Ajax development, debugging techniques, and the future of Ajax and the open web. - It includes examples of building an auto-save feature with Ajax using plain JavaScript, Prototype, and Dojo and discusses language features of JavaScript. - The presentation aims to provide enough knowledge and code examples to get started with Ajax development while addressing open web standards and browser compatibility.

Mocking - Visug session
Mocking - Visug sessionMocking - Visug session
Mocking - Visug session

The document discusses unit testing and mocking frameworks. It begins with an introduction to unit testing principles and describes arranging, acting, and asserting tests. It then demonstrates creating a simple test using test-driven development. The document advocates for using "stunt doubles" like fakes, stubs and mocks to isolate tests from external dependencies. It provides examples of using the Moq mocking framework to define expectations and verify behavior. Key recommendations include writing loosely-coupled code and using a mocking framework to define helpers and expectations for each test.

.netunittestingtestingmockingmoqvisug
The Scaling Problem
    The Problem:
✦
    ✦ jQuery has 6 test suites
    ✦ Run in 11 browsers
    ✦ (Not even including multiple platforms!)

    All need to be run for every commit,
✦
    patch, and plugin.
    JavaScript testing doesn’t scale well.
✦
Distributed Testing
    Hub server
✦

    Clients connect and help run tests
✦

    A simple JavaScript client that can be run
✦
    in all browsers
    ✦ Including mobile browsers!


✦ TestSwarm
FF 3.5 FF 3.5 FF 3.5
                                                  IE 6
                                                         IE 6
       FF 3                                                      IE 6
                                           Op 9
FF 3

                                                                 IE 7

                               TestSwarm
                                                                  IE 7




              Test Suite        Test Suite          Test Suite
Manual Testing
    Push tests to users who follow pre-defined
✦
    steps
    Answer ‘Yes’/’No’ questions which are
✦
    pushed back to the server.
    An effective way to distribute manual test
✦
    load to dozens of clients.

Recommended for you

Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers

The document discusses performance improvements in upcoming browsers. It covers new browsers like Firefox 3.1, Safari 4, Internet Explorer 8, Opera 10, and Google Chrome. These browsers will have better JavaScript engines and take advantage of new technologies like process per tab, native JSON support, and the canvas element to improve performance. Many JavaScript and CSS techniques are also described that can enhance performance by offloading work to the browser instead of through JavaScript libraries.

w3ccssjavascript
iPhone Development For Experienced Web Developers
iPhone Development For Experienced Web DevelopersiPhone Development For Experienced Web Developers
iPhone Development For Experienced Web Developers

This document discusses iPhone development for experienced web developers. It begins with an introduction and poll questions. The main differences from web development are then outlined, such as slower processors, latency considerations, and Objective C. Tools like Xcode and Cocoa are also introduced. The presenters then discuss their project, which uses RESTful web services and JSON. Code examples and concepts like MVC are provided. Memory management, testing, and distribution challenges are also covered. In the end, the presenters discuss what they like and don't like about iPhone development.

JavaFX Advanced
JavaFX AdvancedJavaFX Advanced
JavaFX Advanced

Presentation about the features of JavaFX. See how to use video, different deployment types, JavaScript integration, annimations and more. Demo's not included.

javafx
TestSwarm.com
    Incentives for top testers (t-shirts, books)
✦

    Will be opening for alpha testing very soon
✦

    Help your favorite JavaScript library
✦
    become better tested!
    http://testswarm.com
✦
Questions
    Contact:
✦
    ✦ John Resig
    ✦ http://ejohn.org/
    ✦ http://twitter.com/jeresig

More Related Content

What's hot

Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Leonardo Balter
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
David Padbury
 
Ugo Cei Presentation
Ugo Cei PresentationUgo Cei Presentation
Ugo Cei Presentation
RubyOnRails_dude
 
High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010
Nicholas Zakas
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
dynamis
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
Julien Lecomte
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Simon Willison
 
Unit and functional testing with Siesta
Unit and functional testing with SiestaUnit and functional testing with Siesta
Unit and functional testing with Siesta
Grgur Grisogono
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Nicholas Zakas
 
Video.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video PlayerVideo.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video Player
steveheffernan
 
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Fwdays
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
Marcelio Leal
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications
Seth McLaughlin
 
Making the HTML5 Video element interactive
Making the HTML5 Video element interactiveMaking the HTML5 Video element interactive
Making the HTML5 Video element interactive
Charles Hudson
 
Front End Performance
Front End PerformanceFront End Performance
Front End Performance
Konstantin Käfer
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija
David Torroija
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
Marc Grabanski
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
Justin Cataldo
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
Stevie T
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testing
Mats Bryntse
 

What's hot (20)

Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJRealize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
Realize mais com HTML 5 e CSS 3 - 16 EDTED - RJ
 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight Guy
 
Ugo Cei Presentation
Ugo Cei PresentationUgo Cei Presentation
Ugo Cei Presentation
 
High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010
 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5
 
High Performance Ajax Applications
High Performance Ajax ApplicationsHigh Performance Ajax Applications
High Performance Ajax Applications
 
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript librariesJazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
Jazz up your JavaScript: Unobtrusive scripting with JavaScript libraries
 
Unit and functional testing with Siesta
Unit and functional testing with SiestaUnit and functional testing with Siesta
Unit and functional testing with Siesta
 
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
Progressive Enhancement 2.0 (jQuery Conference SF Bay Area 2011)
 
Video.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video PlayerVideo.js - How to build and HTML5 Video Player
Video.js - How to build and HTML5 Video Player
 
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"Роман Лютиков "Web Apps Performance & JavaScript Compilers"
Роман Лютиков "Web Apps Performance & JavaScript Compilers"
 
HTML 5 - Overview
HTML 5 - OverviewHTML 5 - Overview
HTML 5 - Overview
 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web Applications
 
Making the HTML5 Video element interactive
Making the HTML5 Video element interactiveMaking the HTML5 Video element interactive
Making the HTML5 Video element interactive
 
Front End Performance
Front End PerformanceFront End Performance
Front End Performance
 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David Torroija
 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and Plugins
 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup Performance
 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimization
 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testing
 

Viewers also liked

The JSON Saga
The JSON SagaThe JSON Saga
The JSON Saga
kaven yan
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
kaven yan
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performance
kaven yan
 
Douglas Crockford - Programming Style and Your Brain
Douglas Crockford - Programming Style and Your BrainDouglas Crockford - Programming Style and Your Brain
Douglas Crockford - Programming Style and Your Brain
Web Directions
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers
jeresig
 
Douglas Crockford - Ajax Security
Douglas Crockford - Ajax SecurityDouglas Crockford - Ajax Security
Douglas Crockford - Ajax Security
Web Directions
 
Json
JsonJson
OOP in JavaScript
OOP in JavaScriptOOP in JavaScript
OOP in JavaScript
manugoel2003
 
Good Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas CrockfordGood Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas Crockford
rajivmordani
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
Adieu
 
Advanced JavaScript Concepts
Advanced JavaScript ConceptsAdvanced JavaScript Concepts
Advanced JavaScript Concepts
Naresh Kumar
 
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application Architecture
Nicholas Zakas
 
The DOM is a Mess @ Yahoo
The DOM is a Mess @ YahooThe DOM is a Mess @ Yahoo
The DOM is a Mess @ Yahoo
jeresig
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
guestceb98b
 
Speed Up Your JavaScript
Speed Up Your JavaScriptSpeed Up Your JavaScript
Speed Up Your JavaScript
Nicholas Zakas
 

Viewers also liked (15)

The JSON Saga
The JSON SagaThe JSON Saga
The JSON Saga
 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Dom
 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performance
 
Douglas Crockford - Programming Style and Your Brain
Douglas Crockford - Programming Style and Your BrainDouglas Crockford - Programming Style and Your Brain
Douglas Crockford - Programming Style and Your Brain
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers
 
Douglas Crockford - Ajax Security
Douglas Crockford - Ajax SecurityDouglas Crockford - Ajax Security
Douglas Crockford - Ajax Security
 
Json
JsonJson
Json
 
OOP in JavaScript
OOP in JavaScriptOOP in JavaScript
OOP in JavaScript
 
Good Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas CrockfordGood Parts of JavaScript Douglas Crockford
Good Parts of JavaScript Douglas Crockford
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced Javascript
 
Advanced JavaScript Concepts
Advanced JavaScript ConceptsAdvanced JavaScript Concepts
Advanced JavaScript Concepts
 
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application Architecture
 
The DOM is a Mess @ Yahoo
The DOM is a Mess @ YahooThe DOM is a Mess @ Yahoo
The DOM is a Mess @ Yahoo
 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Language
 
Speed Up Your JavaScript
Speed Up Your JavaScriptSpeed Up Your JavaScript
Speed Up Your JavaScript
 

Similar to Performance, Games, and Distributed Testing in JavaScript

Performance Improvements In Browsers
Performance Improvements In BrowsersPerformance Improvements In Browsers
Performance Improvements In Browsers
GoogleTecTalks
 
jQuery 1.3 and jQuery UI
jQuery 1.3 and jQuery UIjQuery 1.3 and jQuery UI
jQuery 1.3 and jQuery UI
jeresig
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
oscon2007
 
Mocking - Visug session
Mocking - Visug sessionMocking - Visug session
Mocking - Visug session
Maarten Balliauw
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers
jeresig
 
iPhone Development For Experienced Web Developers
iPhone Development For Experienced Web DevelopersiPhone Development For Experienced Web Developers
iPhone Development For Experienced Web Developers
lisab517
 
JavaFX Advanced
JavaFX AdvancedJavaFX Advanced
JavaFX Advanced
Paul Bakker
 
Jslunch6
Jslunch6Jslunch6
Jslunch6
Nao Haida
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MIT
jeresig
 
SEASR Installation
SEASR InstallationSEASR Installation
SEASR Installation
Loretta Auvil
 
Browser-Based testing using Selenium
Browser-Based testing using SeleniumBrowser-Based testing using Selenium
Browser-Based testing using Selenium
ret0
 
Mobile web-debug
Mobile web-debugMobile web-debug
Mobile web-debug
FINN.no
 
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume LaforgeGroovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Guillaume Laforge
 
Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend Testing
Neil Crosby
 
The Future of Firefox and JavaScript
The Future of Firefox and JavaScriptThe Future of Firefox and JavaScript
The Future of Firefox and JavaScript
jeresig
 
E M T Better Performance Monitoring
E M T  Better  Performance  MonitoringE M T  Better  Performance  Monitoring
E M T Better Performance Monitoring
PerconaPerformance
 
Jun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By ExampleJun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By Example
360|Conferences
 
Presentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss ToolsPresentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss Tools
Ganesh Samarthyam
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
mguillem
 
Front end performance tip
Front end performance tipFront end performance tip
Front end performance tip
Steve Yu
 

Similar to Performance, Games, and Distributed Testing in JavaScript (20)

Performance Improvements In Browsers
Performance Improvements In BrowsersPerformance Improvements In Browsers
Performance Improvements In Browsers
 
jQuery 1.3 and jQuery UI
jQuery 1.3 and jQuery UIjQuery 1.3 and jQuery UI
jQuery 1.3 and jQuery UI
 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorial
 
Mocking - Visug session
Mocking - Visug sessionMocking - Visug session
Mocking - Visug session
 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsers
 
iPhone Development For Experienced Web Developers
iPhone Development For Experienced Web DevelopersiPhone Development For Experienced Web Developers
iPhone Development For Experienced Web Developers
 
JavaFX Advanced
JavaFX AdvancedJavaFX Advanced
JavaFX Advanced
 
Jslunch6
Jslunch6Jslunch6
Jslunch6
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MIT
 
SEASR Installation
SEASR InstallationSEASR Installation
SEASR Installation
 
Browser-Based testing using Selenium
Browser-Based testing using SeleniumBrowser-Based testing using Selenium
Browser-Based testing using Selenium
 
Mobile web-debug
Mobile web-debugMobile web-debug
Mobile web-debug
 
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume LaforgeGroovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
Groovy in the Enterprise - Case Studies - TSSJS Prague 2008 - Guillaume Laforge
 
Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend Testing
 
The Future of Firefox and JavaScript
The Future of Firefox and JavaScriptThe Future of Firefox and JavaScript
The Future of Firefox and JavaScript
 
E M T Better Performance Monitoring
E M T  Better  Performance  MonitoringE M T  Better  Performance  Monitoring
E M T Better Performance Monitoring
 
Jun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By ExampleJun Heider - Flex Application Profiling By Example
Jun Heider - Flex Application Profiling By Example
 
Presentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss ToolsPresentations Unusual Java Bugs And Detecting Them Using Foss Tools
Presentations Unusual Java Bugs And Detecting Them Using Foss Tools
 
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and BeyondWebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
WebTest - Efficient Functional Web Testing with HtmlUnit and Beyond
 
Front end performance tip
Front end performance tipFront end performance tip
Front end performance tip
 

More from jeresig

Does Coding Every Day Matter?
Does Coding Every Day Matter?Does Coding Every Day Matter?
Does Coding Every Day Matter?
jeresig
 
Accidentally Becoming a Digital Librarian
Accidentally Becoming a Digital LibrarianAccidentally Becoming a Digital Librarian
Accidentally Becoming a Digital Librarian
jeresig
 
2014: John's Favorite Thing (Neo4j)
2014: John's Favorite Thing (Neo4j)2014: John's Favorite Thing (Neo4j)
2014: John's Favorite Thing (Neo4j)
jeresig
 
Computer Vision as Art Historical Investigation
Computer Vision as Art Historical InvestigationComputer Vision as Art Historical Investigation
Computer Vision as Art Historical Investigation
jeresig
 
Hacking Art History
Hacking Art HistoryHacking Art History
Hacking Art History
jeresig
 
Using JS to teach JS at Khan Academy
Using JS to teach JS at Khan AcademyUsing JS to teach JS at Khan Academy
Using JS to teach JS at Khan Academy
jeresig
 
Applying Computer Vision to Art History
Applying Computer Vision to Art HistoryApplying Computer Vision to Art History
Applying Computer Vision to Art History
jeresig
 
NYARC 2014: Frick/Zeri Results
NYARC 2014: Frick/Zeri ResultsNYARC 2014: Frick/Zeri Results
NYARC 2014: Frick/Zeri Results
jeresig
 
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image AnalysisEmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
jeresig
 
Applying Computer Vision to Art History
Applying Computer Vision to Art HistoryApplying Computer Vision to Art History
Applying Computer Vision to Art History
jeresig
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)
jeresig
 
Introduction to jQuery (Ajax Exp 2006)
Introduction to jQuery (Ajax Exp 2006)Introduction to jQuery (Ajax Exp 2006)
Introduction to jQuery (Ajax Exp 2006)
jeresig
 
jQuery Recommendations to the W3C (2011)
jQuery Recommendations to the W3C (2011)jQuery Recommendations to the W3C (2011)
jQuery Recommendations to the W3C (2011)
jeresig
 
jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)
jeresig
 
jQuery Open Source Process (Knight Foundation 2011)
jQuery Open Source Process (Knight Foundation 2011)jQuery Open Source Process (Knight Foundation 2011)
jQuery Open Source Process (Knight Foundation 2011)
jeresig
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
jeresig
 
jQuery Open Source (Fronteer 2011)
jQuery Open Source (Fronteer 2011)jQuery Open Source (Fronteer 2011)
jQuery Open Source (Fronteer 2011)
jeresig
 
Holistic JavaScript Performance
Holistic JavaScript PerformanceHolistic JavaScript Performance
Holistic JavaScript Performance
jeresig
 
New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)
jeresig
 
Introduction to jQuery (Ajax Exp 2007)
Introduction to jQuery (Ajax Exp 2007)Introduction to jQuery (Ajax Exp 2007)
Introduction to jQuery (Ajax Exp 2007)
jeresig
 

More from jeresig (20)

Does Coding Every Day Matter?
Does Coding Every Day Matter?Does Coding Every Day Matter?
Does Coding Every Day Matter?
 
Accidentally Becoming a Digital Librarian
Accidentally Becoming a Digital LibrarianAccidentally Becoming a Digital Librarian
Accidentally Becoming a Digital Librarian
 
2014: John's Favorite Thing (Neo4j)
2014: John's Favorite Thing (Neo4j)2014: John's Favorite Thing (Neo4j)
2014: John's Favorite Thing (Neo4j)
 
Computer Vision as Art Historical Investigation
Computer Vision as Art Historical InvestigationComputer Vision as Art Historical Investigation
Computer Vision as Art Historical Investigation
 
Hacking Art History
Hacking Art HistoryHacking Art History
Hacking Art History
 
Using JS to teach JS at Khan Academy
Using JS to teach JS at Khan AcademyUsing JS to teach JS at Khan Academy
Using JS to teach JS at Khan Academy
 
Applying Computer Vision to Art History
Applying Computer Vision to Art HistoryApplying Computer Vision to Art History
Applying Computer Vision to Art History
 
NYARC 2014: Frick/Zeri Results
NYARC 2014: Frick/Zeri ResultsNYARC 2014: Frick/Zeri Results
NYARC 2014: Frick/Zeri Results
 
EmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image AnalysisEmpireJS: Hacking Art with Node js and Image Analysis
EmpireJS: Hacking Art with Node js and Image Analysis
 
Applying Computer Vision to Art History
Applying Computer Vision to Art HistoryApplying Computer Vision to Art History
Applying Computer Vision to Art History
 
JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)JavaScript Libraries (Ajax Exp 2006)
JavaScript Libraries (Ajax Exp 2006)
 
Introduction to jQuery (Ajax Exp 2006)
Introduction to jQuery (Ajax Exp 2006)Introduction to jQuery (Ajax Exp 2006)
Introduction to jQuery (Ajax Exp 2006)
 
jQuery Recommendations to the W3C (2011)
jQuery Recommendations to the W3C (2011)jQuery Recommendations to the W3C (2011)
jQuery Recommendations to the W3C (2011)
 
jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)jQuery Open Source Process (RIT 2011)
jQuery Open Source Process (RIT 2011)
 
jQuery Open Source Process (Knight Foundation 2011)
jQuery Open Source Process (Knight Foundation 2011)jQuery Open Source Process (Knight Foundation 2011)
jQuery Open Source Process (Knight Foundation 2011)
 
jQuery Mobile
jQuery MobilejQuery Mobile
jQuery Mobile
 
jQuery Open Source (Fronteer 2011)
jQuery Open Source (Fronteer 2011)jQuery Open Source (Fronteer 2011)
jQuery Open Source (Fronteer 2011)
 
Holistic JavaScript Performance
Holistic JavaScript PerformanceHolistic JavaScript Performance
Holistic JavaScript Performance
 
New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)New Features Coming in Browsers (RIT '09)
New Features Coming in Browsers (RIT '09)
 
Introduction to jQuery (Ajax Exp 2007)
Introduction to jQuery (Ajax Exp 2007)Introduction to jQuery (Ajax Exp 2007)
Introduction to jQuery (Ajax Exp 2007)
 

Recently uploaded

Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
rajancomputerfbd
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
huseindihon
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
Emerging Tech
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
Neo4j
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Bert Blevins
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Mydbops
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
Larry Smarr
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
HackersList
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
Adam Dunkels
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
SynapseIndia
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
Toru Tamaki
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
Andrey Yasko
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
Tatiana Al-Chueyr
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
Safe Software
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
Larry Smarr
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Chris Swan
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
ScyllaDB
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
Enterprise Wired
 

Recently uploaded (20)

Choose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presenceChoose our Linux Web Hosting for a seamless and successful online presence
Choose our Linux Web Hosting for a seamless and successful online presence
 
find out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challengesfind out more about the role of autonomous vehicles in facing global challenges
find out more about the role of autonomous vehicles in facing global challenges
 
Pigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdfPigging Solutions Sustainability brochure.pdf
Pigging Solutions Sustainability brochure.pdf
 
Implementations of Fused Deposition Modeling in real world
Implementations of Fused Deposition Modeling  in real worldImplementations of Fused Deposition Modeling  in real world
Implementations of Fused Deposition Modeling in real world
 
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdfBT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
BT & Neo4j: Knowledge Graphs for Critical Enterprise Systems.pptx.pdf
 
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly DetectionAdvanced Techniques for Cyber Security Analysis and Anomaly Detection
Advanced Techniques for Cyber Security Analysis and Anomaly Detection
 
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - MydbopsScaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
Scaling Connections in PostgreSQL Postgres Bangalore(PGBLR) Meetup-2 - Mydbops
 
The Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU CampusesThe Increasing Use of the National Research Platform by the CSU Campuses
The Increasing Use of the National Research Platform by the CSU Campuses
 
How Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdfHow Social Media Hackers Help You to See Your Wife's Message.pdf
How Social Media Hackers Help You to See Your Wife's Message.pdf
 
How to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptxHow to Build a Profitable IoT Product.pptx
How to Build a Profitable IoT Product.pptx
 
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptxRPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
RPA In Healthcare Benefits, Use Case, Trend And Challenges 2024.pptx
 
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
論文紹介:A Systematic Survey of Prompt Engineering on Vision-Language Foundation ...
 
Comparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdfComparison Table of DiskWarrior Alternatives.pdf
Comparison Table of DiskWarrior Alternatives.pdf
 
Best Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdfBest Practices for Effectively Running dbt in Airflow.pdf
Best Practices for Effectively Running dbt in Airflow.pdf
 
Coordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar SlidesCoordinate Systems in FME 101 - Webinar Slides
Coordinate Systems in FME 101 - Webinar Slides
 
The Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive ComputingThe Rise of Supernetwork Data Intensive Computing
The Rise of Supernetwork Data Intensive Computing
 
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
Fluttercon 2024: Showing that you care about security - OpenSSF Scorecards fo...
 
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-InTrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
TrustArc Webinar - 2024 Data Privacy Trends: A Mid-Year Check-In
 
Mitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing SystemsMitigating the Impact of State Management in Cloud Stream Processing Systems
Mitigating the Impact of State Management in Cloud Stream Processing Systems
 
7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf7 Most Powerful Solar Storms in the History of Earth.pdf
7 Most Powerful Solar Storms in the History of Earth.pdf
 

Performance, Games, and Distributed Testing in JavaScript

  • 1. Measuring Performance, JavaScript Games, and Distributed Testing John Resig http://ejohn.org - http://twitter.com/jeresig
  • 3. Analyzing Performance Optimizing performance is a huge ✦ concern: Faster code = happy users! Measure execution time ✦ Loop the code a few times ✦ Measure the difference: ✦ ✦ (new Date).getTime();
  • 4. Stack Profiling jQuery Stack Profiler ✦ Look for problematic methods and plugins ✦ http://ejohn.org/blog/deep-profiling- ✦ jquery-apps/
  • 6. Accuracy of JavaScript Time We’re measuring the performance of JavaScript from within JavaScript! http://ejohn.org/blog/accuracy-of-javascript-time/
  • 10. 15ms intervals ONLY! Error Rate of 50-750%!
  • 11. Performance Tools How can we get good numbers? ✦ We have to go straight to the source: Use ✦ the tools the browsers provide. Tools: ✦ ✦ Firebug Profiler ✦ Safari Profiler ✦ (Part of Safari 4) ✦ IE 8 Profiler
  • 15. FireUnit A simple JavaScript test suite embedded in ✦ Firebug. http://fireunit.org/ ✦
  • 16. FireUnit Profile Data { fireunit.getProfile(); quot;timequot;: 8.443, quot;callsquot;: 611, quot;dataquot;:[ { quot;namequot;:quot;makeArray()quot;, quot;callsquot;:1, quot;percentquot;:23.58, quot;ownTimequot;:1.991, quot;timequot;:1.991, quot;avgTimequot;:1.991, quot;minTimequot;:1.991, quot;maxTimequot;:1.991, quot;fileNamequot;:quot;jquery.js (line 2059)quot; }, // etc. http://ejohn.org/blog/function-call-profiling/ ]}
  • 17. Complexity Analysis Analyze complexity rather than raw time ✦ jQuery Call Count Profiler (uses FireUnit) ✦ Method Calls Big-O .addClass(quot;testquot;); 542 6n .addClass(quot;testquot;); 592 6n .removeClass(quot;testquot;); 754 8n .removeClass(quot;testquot;); 610 6n .css(quot;colorquot;, quot;redquot;); 495 5n .css({color: quot;redquot;, border: quot;1px 887 9n solid redquot;}); .remove(); 23772 2n+n2 .append(quot;<p>test</p>quot;); 307 3n
  • 18. Complexity Analysis Reducing call count helps to reduce ✦ complexity Results for 1.3.3: ✦ Method Calls Big-O .remove(); 298 3n .html(quot;<p>test</p>quot;); 507 5n .empty(); 200 2n http://ejohn.org/blog/function-call-profiling/
  • 19. Why JavaScript Games Are HARD to Build
  • 20. Browser-Based Games No installation required ✦ (Will be able to play at work!) ✦
  • 21. Why not Flash? JavaScript works everywhere ✦ ✦ Desktop ✦ iPhone / Mobile Device ✦ Wii ✦ OLPC JavaScript is an open technology ✦
  • 22. Goals of a game Should be Multiplayer ✦ Can’t be casually cheated ✦ Work well everywhere ✦ Addictive ✦
  • 23. Why Multiplayer? Incredibly addictive ✦ ✦ No longer “alone” ✦ Enticed to continue playing
  • 24. 3 Styles of Games Strategy ✦ Intelligence ✦ Accuracy ✦
  • 25. Strategy Games Require a lot of time to think ✦ Generally last over a couple hours or days ✦ Replayability ✦ Hard to cheat ✦
  • 26. WarFish http://warfish.net/ ✦
  • 27. Nile Online http://www.playnileonline.com/ ✦
  • 28. Strategy Games Very server-side heavy ✦ ✦ Most logic hidden from the user Hard to cheat ✦ ✦ Casual cheaters can’t change values ✦ Dedicated cheaters have to write full AI
  • 29. Intelligence Games Player’s intelligence/knowledge challenged ✦ Games could be quick or slow-paced ✦ Easy to cheat ✦ ✦ Casual cheaters can open dictionary / encyclopedia for answers
  • 30. Word Twist http://wordtwist.org/ ✦
  • 31. Babble http://playbabble.com/ ✦
  • 32. Iron Sudoku http://ironsudoku.com/ ✦
  • 33. Speed/Accuracy Games Require low latency ✦ Fast-paced and addictive ✦ JavaScript completely fails ✦ ✦ Garbage Collection cycles freeze the browser None, or few, Accuracy-centric JavaScript ✦ games Experienced coders can easily cheat ✦ ✦ (A bot to hit the keys at the right time)
  • 34. Guitar Hero http://ejohn.org/apps/hero/
  • 35. Guitar Hero Heavily dependent upon accuracy ✦ ✦ (Hit the right notes at the right time) Garbage collection cycles absolutely kill ✦ the game Rendering the play area is also difficult ✦ ✦ And impossible in all browsers. ✦ (Use HTML 5 Canvas Element)
  • 36. Failures on All Ends Strategy: Slow, secret server-side code ✦ Intelligence: Easily cheatable ✦ Accuracy: Too hard to implement ✦ Optimal solution would be a combination ✦ of the above. JavaScript games can’t be like other games, ✦ have to be unique.
  • 37. What can make a fun game? Quick play ✦ Points ✦ High Scores ✦ Head-to-head competition ✦
  • 38. Wordsplay Real-time Boggle ✦ Head-to-head with other players ✦ http://www.wordsplay.net/
  • 39. Tringo Tetris + Bingo (based on a Second Life ✦ game) http://ejohn.org/tringo/
  • 40. DeepLeap Fast-paced Scrabble-like game ✦ Speed + Intelligence + Strategy ✦ http://deepleap.org/
  • 41. vs. Cheating All words are recorded with exact time ✦ information Game is “played back” on the server to ✦ verify score integrity using Server-Side JS This data can be used to simulate a multi- ✦ player experience!
  • 42. DeepLeap Works in multiple languages ✦ ✦ Dictionaries pulled from OpenOffice, can build a Spanish version in < 5sec Players can challenge each other head-to- ✦ head Score multiplier (carry over from Guitar ✦ Hero)
  • 45. Cost / Benefit IE 7 IE 6 FF 3 Safari 3 Opera 9.5 Cost Benefit Draw a line in the sand.
  • 46. Graded Support Yahoo Browser Compatibility
  • 47. Browser Support Grid IE Firefox Safari Opera Chrome Previous 6.0 2.0 3.0 9.5 Current 7.0 3.0 3.2 9.6 1.0 Next 8.0 3.1 4.0 10.0 2.0 jQuery Browser Support
  • 48. Browser Support Grid IE Firefox Safari Opera Chrome Previous 3.0 9.5 6.0 2.0 Current 7.0 3.0 3.2 9.6 1.0 Next 8.0 3.1 4.0 2.0 10.0 jQuery 1.3 Browser Support
  • 49. The Scaling Problem The Problem: ✦ ✦ jQuery has 6 test suites ✦ Run in 11 browsers ✦ (Not even including multiple platforms!) All need to be run for every commit, ✦ patch, and plugin. JavaScript testing doesn’t scale well. ✦
  • 50. Distributed Testing Hub server ✦ Clients connect and help run tests ✦ A simple JavaScript client that can be run ✦ in all browsers ✦ Including mobile browsers! ✦ TestSwarm
  • 51. FF 3.5 FF 3.5 FF 3.5 IE 6 IE 6 FF 3 IE 6 Op 9 FF 3 IE 7 TestSwarm IE 7 Test Suite Test Suite Test Suite
  • 52. Manual Testing Push tests to users who follow pre-defined ✦ steps Answer ‘Yes’/’No’ questions which are ✦ pushed back to the server. An effective way to distribute manual test ✦ load to dozens of clients.
  • 53. TestSwarm.com Incentives for top testers (t-shirts, books) ✦ Will be opening for alpha testing very soon ✦ Help your favorite JavaScript library ✦ become better tested! http://testswarm.com ✦
  • 54. Questions Contact: ✦ ✦ John Resig ✦ http://ejohn.org/ ✦ http://twitter.com/jeresig