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/
Accuracy of
  JavaScript Time
We’re measuring the performance of
 JavaScript from within JavaScript!


  http://ejohn.org/blog/accuracy-of-javascript-time/
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
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/ ]}
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!)
✦
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
✦
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
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/
  ✦
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.
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/
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
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
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.
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
 
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 ApplicationsJulien 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
 
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 PerformanceJustin 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 Crockfordrajivmordani
 
Advanced Javascript
Advanced JavascriptAdvanced Javascript
Advanced JavascriptAdieu
 
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 BrowsersGoogleTecTalks
 
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 Tutorialoscon2007
 
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 Developerslisab517
 
JavaFX Advanced
JavaFX AdvancedJavaFX Advanced
JavaFX Advanced
Paul Bakker
 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MIT
jeresig
 
Browser-Based testing using Selenium
Browser-Based testing using SeleniumBrowser-Based testing using Selenium
Browser-Based testing using Seleniumret0
 
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 MonitoringPerconaPerformance
 
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 ToolsGanesh 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

Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 

Recently uploaded (20)

Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.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/
  • 5.
  • 6. Accuracy of JavaScript Time We’re measuring the performance of JavaScript from within JavaScript! http://ejohn.org/blog/accuracy-of-javascript-time/
  • 7.
  • 8.
  • 9.
  • 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