State of the art: Server-Side JavaScript (ParisJS)
-
Upload
alexandre-morgaut -
Category
Technology
-
view
8.248 -
download
1
description
Transcript of State of the art: Server-Side JavaScript (ParisJS)
![Page 1: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/1.jpg)
State of the ArtServer-Side JavaScript
@amorgaut@thibarg
4d.com
#10
2011-08-31
![Page 2: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/2.jpg)
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)
![Page 3: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/3.jpg)
History
![Page 4: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/4.jpg)
Birth1995 LiveScript/JavaScript
1996 Microsoft JScript (IE4)NetScape Enterprise Server 2aka LiveWire/iPlanet
1997 ECMAScript 1“DHTML”Windows IIS 3
![Page 5: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/5.jpg)
Maturity1998 - 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
![Page 6: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/6.jpg)
SSJS: The comeback2008Aptana Jaxer CouchDB
2009Narwhal & JackServerJS/CommonJS Node.JSECMAScript 5
2010Helma NG -> RingoJSSun Phobos
2011Wakanda
![Page 7: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/7.jpg)
SSJS: The comeback2008Aptana Jaxer CouchDB
2009Narwhal & JackServerJS/CommonJS Node.JSECMAScript 5
2010Helma NG -> RingoJSSun Phobos
2011Wakanda
![Page 8: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/8.jpg)
SSJS: The comeback2008Aptana Jaxer CouchDB
2009Narwhal & JackServerJS/CommonJS Node.JSECMAScript 5
2010Helma NG -> RingoJSSun Phobos
2011Wakanda
![Page 9: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/9.jpg)
SSJS: The comeback2008Aptana Jaxer CouchDB
2009Narwhal & JackServerJS/CommonJS Node.JSECMAScript 5
2010Helma NG -> RingoJSSun Phobos
2011Wakanda
![Page 10: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/10.jpg)
http://en.wikipedia.org/wiki/Comparison_of_server-side_JavaScript_solutions
60+ existing solutions
![Page 11: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/11.jpg)
Engines
![Page 12: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/12.jpg)
Engines
SpiderMonkeyTraceMonkey (JIT)JägerMonkey (JIT)IonMonkey (JIT)
V8
webkit JavaScriptCore: JSCSquirrelFish Extreme: SFX (JIT)
Nitro
TridentChakra
Tamarin CarakanFuthark
Rhino
![Page 13: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/13.jpg)
Engines
SpiderMonkeyNarwhal
CouchDB, MongoDBSpidernode
. . .
V8
webkit JavaScriptCore: JSCNarwhalWakanda
. . .
RhinoNarwhalRingoJS
Persevere. . .
NarwhalAkshellNode.js
. . .
C/C++C/C++
C/C++
SpiderMonkey in Java
Trident / ChakraASP / .NET
C/C++
![Page 14: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/14.jpg)
Benchmarks?
![Page 15: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/15.jpg)
Persevere JavaScriptDB(April 2009)
http://www.sitepen.com/blog/2009/04/20/javascriptdb-perseveres-new-high-performance-storage-engine/
![Page 16: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/16.jpg)
Node vs Thin vs Narwhal(september 2009)
http://four.livejournal.com/1019177.html
300 concurrent clients
completed requests:thin 36045node 35668narwhal 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
![Page 17: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/17.jpg)
RingoJS vs NodeJS(September 2010)
http://hns.github.com/2010/09/21/benchmark.html
![Page 18: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/18.jpg)
Sunspider 0.9.1(August 2011)
http://expansive-derivation.ossreleasefeed.com/2011/08/javascript-performance-test-results-with-sunspider/
78654321
![Page 19: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/19.jpg)
Main Concepts
![Page 20: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/20.jpg)
Integration-OrientedRhino
SpiderMonkey in JavaInteraction with Java (APIs and objects)Helma, Persevere, Narwhal*, RingoJS, Sun Phobos...
JScript .NetChakra (C++)Interaction with Windows APIs
![Page 21: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/21.jpg)
Async. Event-basedOne single thread
Cooperative («one at a time») with async. callbacks
nodejs (V8)
![Page 22: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/22.jpg)
Async. Event-basedOne 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
![Page 23: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/23.jpg)
Thread-basedOne thread per context
Preemptive: Parallel code execution
About all others
![Page 24: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/24.jpg)
Thread-basedOne 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
![Page 25: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/25.jpg)
Database-drivenCouchDB, MongoDB (SpiderMonkey):
Document Store
Wakanda (JavaScriptCore)Object Store
![Page 26: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/26.jpg)
APIs
![Page 27: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/27.jpg)
CommonJSModules
Packages
Promises
System
Unit-Testing
Binary
File
JSGI
Stream
http://wiki.commonjs.org/wiki/CommonJS
![Page 28: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/28.jpg)
Node.js async APIs
Buffer
Events
File
Net
OS
Process
Streams
Timers
. . .
http://nodejs.org/docs/v0.5.5/api/
![Page 29: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/29.jpg)
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
![Page 30: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/30.jpg)
Packages & Modulesgithub
lot of commonjs modules in several repositories (Persevere, Narwhal, RingoJS, ...)
NPM: Node Package Manager3600+ packages
CPM: CommonJS Package Manager (new)
http://wiki.commonjs.org/wiki/CommonJS
![Page 31: State of the art: Server-Side JavaScript (ParisJS)](https://reader033.fdocuments.in/reader033/viewer/2022052523/55512bedb4c905b3598b4b86/html5/thumbnails/31.jpg)
State of the Art Server-Side JavaScript
The End
@amorgaut@thibarg@wakandasoft
4d.comwakanday.org
@wakandasoft
See the full version of this presentation at Wakanday aka
JS.everywhere(Boston, October, 15)