• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
იოსებ ძმანაშვილი   Node.js
 

იოსებ ძმანაშვილი Node.js

on

  • 336 views

სტუდენტური ჰაკათონი - cst.unihack.ge ...

სტუდენტური ჰაკათონი - cst.unihack.ge
პრეზენტაცია იოსებ ძმანაშვილი - Node.JS

http://www.youtube.com/watch?v=GO74oM2Fb4o
uniHack hack@CST

Statistics

Views

Total Views
336
Views on SlideShare
336
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    იოსებ ძმანაშვილი   Node.js იოსებ ძმანაშვილი Node.js Presentation Transcript

    • NODE.JS INTRO A Talk By Ioseb Dzmanashvili @iosebi Wednesday, December 25, 13
    • ABOUT ME Software Architect at AzRy LLC Assistant Professor at CST Ph.D Student at Technical University of Georgia V8 Contributor Wednesday, December 25, 13
    • ABOUT NODE.JS Released in 2009 by Ryan Dahl Is built on V8 JavaScript Engine Based on event-driven non-blocking I/O Platform for fast and scalable network apps Wednesday, December 25, 13
    • WHAT MAKES IT AWESOME? Easy of use Server side JavaScript Active community Repository of awesome modules npm install [module name] Wednesday, December 25, 13
    • SERIOUSLY? IS THAT ALL? Wednesday, December 25, 13
    • WELL, NO Built on V8 JavaScript engine Node.js never blocks on I/O operations You do not need to manage threads No expensive context switching No memory waste on execution stacks Wednesday, December 25, 13
    • V8 ADVANTAGES Fastest JavaScript runtime No JIT, it compiles JavaScript into Assembler Short(really short) garbage collector cycles Great implementation of EcmaScript 5 and EcmaScript 6 Wednesday, December 25, 13
    • MAJOR BOTTLENECKS I/O operations (Disk, RAM, Network) Threaded concurrency Wednesday, December 25, 13
    • I/O LATENCY I/O L1-Cache 3 L2-Cache 14 RAM 250 Hard Disk 41.000.000 Network Wednesday, December 25, 13 CPU Cycles 240.000.000
    • WHAT CONTRIBUTES TO LATENCY? Wednesday, December 25, 13
    • TYPICAL CODE EXAMPLE var query = "SELECT * FROM t"; var result = db.query(query); while(result.hasNext()) { print(result.next()); } db.free(result); Wednesday, December 25, 13
    • NON BLOCKING EXAMPLE var query = "SELECT * FROM t"; db.query(query, function(result) { while(result.hasNext()) { print(result.next()); } }); // do something here Wednesday, December 25, 13
    • FILE I/O EXAMPLE $file = fopen("file.txt", "r"); while(!feof($file)){ $line = fgets($file); // do something with line } fclose($file); Wednesday, December 25, 13
    • ASYNC I/O WITH FILES function readFile(file) { var br = new BufferedReader(file, ...); br.on("error", function(error) { // handle error }).on("line", function(line) { // do something meaningful with line }).on("end", function() { // we are done }).read(); } readFile("/path/to/file"); Wednesday, December 25, 13
    • HOW NODE.JS SOLVES I/O PROBLEMS FOR ME? Wednesday, December 25, 13
    • SINGLE THREADED 1 Wednesday, December 25, 13
    • EVENT LOOP Single Thread Wednesday, December 25, 13
    • PROGRAM EXECUTION FLOW fn0(); I/O is handled asynchronously Wednesday, December 25, 13 fn1(); NETWORK I/O fn2(); FS I/O fn3(); Program never waits for I/ O operations completion DB I/O FS I/O
    • DISADVANTAGES? Wednesday, December 25, 13
    • IT IS JAVASCRIPT Wednesday, December 25, 13
    • QUESTIONS? Wednesday, December 25, 13
    • THANK YOU Wednesday, December 25, 13