Upgrade to Pro — share decks privately, control downloads, hide ads and more …

State of the art: Server Side JavaScript - @Par...

State of the art: Server Side JavaScript - @ParisJS #10

Alexandre Morgaut

October 08, 2011
Tweet

More Decks by Alexandre Morgaut

Other Decks in Technology

Transcript

  1. Notes These slides are part of a 15min version of

    the talk for ParisJS The full version will be presented at Wakanday aka JS.everywhere(Boston, October, 15)
  2. Birth 1995 LiveScript/JavaScript 1996 Microsoft JScript (IE4) NetScape Enterprise Server

    2 aka LiveWire/iPlanet 1997 ECMAScript 1 “DHTML” Windows IIS 3
  3. Maturity 1998 - DOM, Mozilla Rhino 1999 - ES3, XMLHttpRequest,

    HTML 4 2000 - ActionScript, Helma Hop 2001 - JSON, Apple JavaScript OSA 2002 - JSLint 2003 - JavaScript Adobe Press 2004 - E4X , “Web 2.0” 2005 - Prototype, “Ajax” 2006 - Firebug, jQuery, “Comet”, “HTML5” 2007 - SitePoint Persevere, Rhino on Rails
  4. SSJS: The comeback 2008 Aptana Jaxer CouchDB 2009 Narwhal &

    Jack ServerJS/CommonJS Node.JS ECMAScript 5 2010 Helma NG -> RingoJS Sun Phobos 2011 Wakanda
  5. SSJS: The comeback 2008 Aptana Jaxer CouchDB 2009 Narwhal &

    Jack ServerJS/CommonJS Node.JS ECMAScript 5 2010 Helma NG -> RingoJS Sun Phobos 2011 Wakanda
  6. SSJS: The comeback 2008 Aptana Jaxer CouchDB 2009 Narwhal &

    Jack ServerJS/CommonJS Node.JS ECMAScript 5 2010 Helma NG -> RingoJS Sun Phobos 2011 Wakanda
  7. SSJS: The comeback 2008 Aptana Jaxer CouchDB 2009 Narwhal &

    Jack ServerJS/CommonJS Node.JS ECMAScript 5 2010 Helma NG -> RingoJS Sun Phobos 2011 Wakanda
  8. Engines SpiderMonkey TraceMonkey (JIT) JägerMonkey (JIT) IonMonkey (JIT) V8 webkit

    JavaScriptCore: JSC SquirrelFish Extreme: SFX (JIT) Nitro Trident Chakra Tamarin Carakan Futhark Rhino
  9. Engines SpiderMonkey Narwhal CouchDB, MongoDB Spidernode . . . V8

    webkit JavaScriptCore: JSC Narwhal Wakanda . . . Rhino Narwhal RingoJS Persevere . . . Narwhal Akshell Node.js . . . C/C++ C/C++ C/C++ SpiderMonkey in Java Trident / Chakra ASP / .NET C/C++
  10. Node vs Thin vs Narwhal (september 2009) http:/ /four.livejournal.com/1019177.html 300

    concurrent clients completed requests: thin 36045 node 35668 narwhal 2921 > summary(node300$ttime) Min. 1st Qu. Median Mean 3rd Qu. Max. 12.0 66.0 112.0 239.4 157.0 12200.0 > summary(thin300$ttime) Min. 1st Qu. Median Mean 3rd Qu. Max. 71.0 84.0 87.0 208.7 107.0 23950.0 > summary(narwhal300$ttime) Min. 1st Qu. Median Mean 3rd Qu. Max. 928 2837 2935 2921 3018 8759
  11. Integration-Oriented Rhino SpiderMonkey in Java Interaction with Java (APIs and

    objects) Helma, Persevere, Narwhal*, RingoJS, Sun Phobos... JScript .Net Chakra (C++) Interaction with Windows APIs
  12. Async. Event-based One single thread Cooperative («one at a time»)

    with async. callbacks nodejs (V8) Cons Vulnerable to synchronous operations Share failure Doesn’t use other cores Hard to debug and maintain Pros Can handle a lot of requests Low memory usage Uses only one core
  13. Thread-based One thread per context Preemptive: Parallel code execution About

    all others Cons Memory/CPU limits Race conditions, deadlocks, ... (internal, C++) Uses all available cores Pros Vertical scalability (cloud) Thread-safety for concurrent access Uses all available cores
  14. Node.js async APIs Buffer Events File Net OS Process Streams

    Timers . . . http:/ /nodejs.org/docs/v0.5.5/api/
  15. W3C / HTML5 & other standards Console Blob, Blob URL*

    DataView* File / FileSystem Modules* Progress Events Structured clones Typed Arrays* Web Sockets Web Storage Web Workers XHR 2
  16. Packages & Modules github lot of commonjs modules in several

    repositories (Persevere, Narwhal, RingoJS, ...) NPM: Node Package Manager 3600+ packages CPM: CommonJS Package Manager (new) http:/ /wiki.commonjs.org/wiki/CommonJS
  17. State of the Art Server-Side JavaScript The End @amorgaut @thibarg

    @wakandasoft 4d.com wakanday.org @wakandasoft See the full version of this presentation at Wakanday aka JS.everywhere(Boston, October, 15)