SlideShare ist ein Scribd-Unternehmen logo
1 von 54
Downloaden Sie, um offline zu lesen
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 diļ¬€erence:
āœ¦
    āœ¦ (new Date).getTime();
Stack Proļ¬ling
    jQuery Stack Proļ¬ler
āœ¦

    Look for problematic methods and plugins
āœ¦

    http://ejohn.org/blog/deep-proļ¬ling-
āœ¦
    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 Proļ¬ler
    āœ¦ Safari Proļ¬ler
      āœ¦ (Part of Safari 4)
    āœ¦ IE 8 Proļ¬ler
Firebug Proļ¬ler
Safari 4 Proļ¬ler
IE 8 Proļ¬ler
FireUnit
    A simple JavaScript test suite embedded in
āœ¦
    Firebug.
    http://ļ¬reunit.org/
āœ¦
FireUnit Proļ¬le Data

                                            {
 ļ¬reunit.getProļ¬le();                              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-proļ¬ling/ ]}
Complexity Analysis
             Analyze complexity rather than raw time
         āœ¦

             jQuery Call Count Proļ¬ler (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-proļ¬ling/
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://warļ¬sh.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 diļ¬ƒcult
āœ¦
    āœ¦ 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 OpenOļ¬ƒce,
      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 / Beneļ¬t




  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-deļ¬ned
āœ¦
    steps
    Answer ā€˜Yesā€™/ā€™Noā€™ questions which are
āœ¦
    pushed back to the server.
    An eļ¬€ective 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

Weitere Ƥhnliche Inhalte

Was ist angesagt?

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 - RJLeonardo Balter
Ā 
HTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyHTML5 for the Silverlight Guy
HTML5 for the Silverlight GuyDavid Padbury
Ā 
Ugo Cei Presentation
Ugo Cei PresentationUgo Cei Presentation
Ugo Cei PresentationRubyOnRails_dude
Ā 
High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010High Performance JavaScript - WebDirections USA 2010
High Performance JavaScript - WebDirections USA 2010Nicholas Zakas
Ā 
Keypoints html5
Keypoints html5Keypoints html5
Keypoints html5dynamis
Ā 
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 librariesSimon Willison
Ā 
Unit and functional testing with Siesta
Unit and functional testing with SiestaUnit and functional testing with Siesta
Unit and functional testing with SiestaGrgur 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 Playersteveheffernan
Ā 
Š Š¾Š¼Š°Š½ Š›ŃŽŃ‚ŠøŠŗŠ¾Š² "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 - OverviewMarcelio Leal
Ā 
Testing Web Applications
Testing Web ApplicationsTesting Web Applications
Testing Web ApplicationsSeth McLaughlin
Ā 
Making the HTML5 Video element interactive
Making the HTML5 Video element interactiveMaking the HTML5 Video element interactive
Making the HTML5 Video element interactiveCharles Hudson
Ā 
Testing nightwatch, by David Torroija
Testing nightwatch, by David TorroijaTesting nightwatch, by David Torroija
Testing nightwatch, by David TorroijaDavid Torroija
Ā 
jQuery UI and Plugins
jQuery UI and PluginsjQuery UI and Plugins
jQuery UI and PluginsMarc Grabanski
Ā 
#NewMeetup Performance
#NewMeetup Performance#NewMeetup Performance
#NewMeetup PerformanceJustin Cataldo
Ā 
Front end performance optimization
Front end performance optimizationFront end performance optimization
Front end performance optimizationStevie T
Ā 
Java script unit testing
Java script unit testingJava script unit testing
Java script unit testingMats Bryntse
Ā 

Was ist angesagt? (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
Ā 

Andere mochten auch

The JSON Saga
The JSON SagaThe JSON Saga
The JSON Sagakaven yan
Ā 
The Theory Of The Dom
The Theory Of The DomThe Theory Of The Dom
The Theory Of The Domkaven yan
Ā 
Ajax Performance
Ajax PerformanceAjax Performance
Ajax Performancekaven 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 BrainWeb Directions
Ā 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsersjeresig
Ā 
Douglas Crockford - Ajax Security
Douglas Crockford - Ajax SecurityDouglas Crockford - Ajax Security
Douglas Crockford - Ajax SecurityWeb Directions
Ā 
OOP in JavaScript
OOP in JavaScriptOOP in JavaScript
OOP in JavaScriptmanugoel2003
Ā 
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 ConceptsNaresh Kumar
Ā 
Scalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureScalable JavaScript Application Architecture
Scalable JavaScript Application ArchitectureNicholas Zakas
Ā 
The DOM is a Mess @ Yahoo
The DOM is a Mess @ YahooThe DOM is a Mess @ Yahoo
The DOM is a Mess @ Yahoojeresig
Ā 
The JavaScript Programming Language
The JavaScript Programming LanguageThe JavaScript Programming Language
The JavaScript Programming Languageguestceb98b
Ā 
Speed Up Your JavaScript
Speed Up Your JavaScriptSpeed Up Your JavaScript
Speed Up Your JavaScriptNicholas Zakas
Ā 

Andere mochten auch (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
Ā 

Ƅhnlich wie 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 UIjeresig
Ā 
Ajax Tutorial
Ajax TutorialAjax Tutorial
Ajax Tutorialoscon2007
Ā 
Mocking - Visug session
Mocking - Visug sessionMocking - Visug session
Mocking - Visug sessionMaarten Balliauw
Ā 
Performance Improvements in Browsers
Performance Improvements in BrowsersPerformance Improvements in Browsers
Performance Improvements in Browsersjeresig
Ā 
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 AdvancedPaul Bakker
Ā 
Jslunch6
Jslunch6Jslunch6
Jslunch6Nao Haida
Ā 
Learning jQuery @ MIT
Learning jQuery @ MITLearning jQuery @ MIT
Learning jQuery @ MITjeresig
Ā 
SEASR Installation
SEASR InstallationSEASR Installation
SEASR InstallationLoretta Auvil
Ā 
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-debugFINN.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 LaforgeGuillaume Laforge
Ā 
Automated Frontend Testing
Automated Frontend TestingAutomated Frontend Testing
Automated Frontend TestingNeil Crosby
Ā 
The Future of Firefox and JavaScript
The Future of Firefox and JavaScriptThe Future of Firefox and JavaScript
The Future of Firefox and JavaScriptjeresig
Ā 
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 Example360|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 Beyondmguillem
Ā 
Front end performance tip
Front end performance tipFront end performance tip
Front end performance tipSteve Yu
Ā 

Ƅhnlich wie 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
Ā 

Mehr von 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 Librarianjeresig
Ā 
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 Investigationjeresig
Ā 
Hacking Art History
Hacking Art HistoryHacking Art History
Hacking Art Historyjeresig
Ā 
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 Academyjeresig
Ā 
Applying Computer Vision to Art History
Applying Computer Vision to Art HistoryApplying Computer Vision to Art History
Applying Computer Vision to Art Historyjeresig
Ā 
NYARC 2014: Frick/Zeri Results
NYARC 2014: Frick/Zeri ResultsNYARC 2014: Frick/Zeri Results
NYARC 2014: Frick/Zeri Resultsjeresig
Ā 
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 Analysisjeresig
Ā 
Applying Computer Vision to Art History
Applying Computer Vision to Art HistoryApplying Computer Vision to Art History
Applying Computer Vision to Art Historyjeresig
Ā 
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 Mobilejeresig
Ā 
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 Performancejeresig
Ā 
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
Ā 

Mehr von 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)
Ā 

KĆ¼rzlich hochgeladen

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
Ā 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
Ā 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
Ā 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
Ā 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
Ā 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
Ā 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
Ā 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
Ā 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
Ā 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
Ā 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
Ā 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
Ā 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
Ā 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
Ā 
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelDeepika Singh
Ā 

KĆ¼rzlich hochgeladen (20)

Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
Ā 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
Ā 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Ā 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Ā 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Ā 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
Ā 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Ā 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Ā 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
Ā 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Ā 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
Ā 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
Ā 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
Ā 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Ā 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Ā 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Ā 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Ā 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Ā 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
Ā 
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls šŸ„° 8617370543 Service Offer VIP Hot Model
Ā 

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 diļ¬€erence: āœ¦ āœ¦ (new Date).getTime();
  • 4. Stack Proļ¬ling jQuery Stack Proļ¬ler āœ¦ Look for problematic methods and plugins āœ¦ http://ejohn.org/blog/deep-proļ¬ling- āœ¦ 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 Proļ¬ler āœ¦ Safari Proļ¬ler āœ¦ (Part of Safari 4) āœ¦ IE 8 Proļ¬ler
  • 15. FireUnit A simple JavaScript test suite embedded in āœ¦ Firebug. http://ļ¬reunit.org/ āœ¦
  • 16. FireUnit Proļ¬le Data { ļ¬reunit.getProļ¬le(); 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-proļ¬ling/ ]}
  • 17. Complexity Analysis Analyze complexity rather than raw time āœ¦ jQuery Call Count Proļ¬ler (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-proļ¬ling/
  • 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://warļ¬sh.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 diļ¬ƒcult āœ¦ āœ¦ 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 OpenOļ¬ƒce, can build a Spanish version in < 5sec Players can challenge each other head-to- āœ¦ head Score multiplier (carry over from Guitar āœ¦ Hero)
  • 45. Cost / Beneļ¬t 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-deļ¬ned āœ¦ steps Answer ā€˜Yesā€™/ā€™Noā€™ questions which are āœ¦ pushed back to the server. An eļ¬€ective 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