2. Milestones
● Server-side Javascript based on Google V8
● Non-blocking Input/Output event model
● 100% CPU using: one process - one thread -
one core
3. Google V8
● V8 JavaScript VM is used in Google Chrome
● No JIT, all JavaScript is compiled to
assembler
● Hidden classes optimization from Self (V8 does not
dynamically lookup access properties, instead it uses hidden classes that are created behind the
scene)
● Improved garbage collector
4. Non-blocking I/O
The non-blocking nature makes node.js a good
fit for comet and next generation realtime web-
applications
nginx: non-blocking
apache: threaded
non-blocking can handle more requests-per-second and uses a lot less memory
5. NodeJS Perks: front- and backend
● One Javascript - different approaches
● Common libs
● Unit-tests for both sides
7. NodeJS Perks: Comet
Comet is a web application model in which a long-held HTTP request allows
a web server to push data to a browser, without the browser explicitly
requesting it.
● Comet servers need to have a lot of open connections
● One thread-per-connection does not scale
● The solution is to use event based servers
● It’s only possible to create event based servers in
node.js
8. NodeJS Weaknesses
● Due to Javascript flexible nature it's hard to
locate mistakes
● Strict convention rules are highly
recommended
● One process serve plenty requests: so,
mistake in one request may "freeze" other.
● Non-trivial garbage collector (closures, long-term
processes)
● Strange open-source community (no standards)
● No backward compatibility