Skip to content
HomeVideosBooks
AllTopicsTrends
BlogsPodcasts
HistoryListsWatch laterLiked videosFollowing

The videos, books, blogs and podcasts Hacker News keeps recommending, all in one place.

VideosBooksBlogsPodcastsAboutPrivacySettings

Data from Hacker News, HackerTube, HackerBooks, HackerBlogs and Open Library. Credits · Not affiliated with Y Combinator.

HomeVideosBooksBlogsPodcasts
Ctrl K
    Cover of Node Web development

    Node Web development

    David Herron

    Web & InternetProgramming
    Open LibraryAmazon
    Stats for nerds
    0recommend
    2mentions
    2people
    2011years
    100% neutral

    What Hacker News says

    1. timrichardOct 2011
      In Node Web Development [Packt], the author uses a Fibonacci algorithm as an example that could block the event loop.

      It outlines one solution where the calculation is split into callbacks dispatched through the event loop, making use of process.nextTick()

      thread
    2. inakiabtSep 2011
      I'm new with Node.js, but the "shorten" process shouldn't be an asynchronous process? Maybe something like this?:

         app.get('/shorten', function(req, res) {
            console.log('Shortening url...');
            shortener.shorten(req.param('u'), function(result){
              res.send(result);
            });	
          });
      
      It's well known that Redis is pretty fast, but, citing "Node Web Development" (http://www.amazon.com/Node-Web-Development-David-Herron/dp/1...) on it "Architecture: Threads versus asynchronous event-driven" chapter, "(...)Depending on the query that pause can be quite long. This is bad because while the entire thread is idling another request might come in, and if all the threads are busy it will be dropped. Looks like quite a waste. Context switching is not free either, the more threads we use the more time the CPU spends in storing and restoring the state. Furthermore, the execution stack for each thread takes up memory. Simply by using asynchronous, event-driven I/O, Node removes most of this overhead while introducing very little on its own."

      It is not a criticism but a question.

      thread

    Related

    Cover of Agile web development with rails
    2007–2025

    Agile web development with rails

    Dave Thomas
    67 recommend · 137
    Cover of The node beginner book
    2011–2016

    The node beginner book

    Manuel Kiessling
    9 recommend · 16
    Cover of Node Up and Running
    2012

    Node Up and Running

    Mike Wilson
    0 recommend · 2
    Cover of Effective JavaScript
    2013–2022

    Effective JavaScript

    David Herman
    20 recommend · 29
    Cover of JavaScript
    2007–2023

    JavaScript

    David Flanagan
    22 recommend · 32
    Cover of The Rust Programming Language
    2015–2026

    The Rust Programming Language

    Steve Klabnik
    170 recommend · 257
    Cover of Weaving the Web
    2008–2026

    Weaving the Web

    Tim Berners-Lee
    10 recommend · 30
    Cover of Building Hypermedia APIs with HTML5 and Node
    2012–2016

    Building Hypermedia APIs with HTML5 and Node

    Michael Amundsen
    2 recommend · 3