• Is it possible to flush this buffer to be sent immediately somehow ? or get called until the buffer is really full ?
    As if it is making an unnecessary break before each send. If I reduce the chunk size from 5kb to 256bytes, the average speed is dramatically decreased.

    I can't send 20kb in one go, I get "New interpreter error: LOW_MEMORY,MEMORY". If I send only 1 chunk of 5bk, it still takes 5 seconds even straight away without ondrain:

    function onPageRequest(req, res) {
      res.writeHead(200, {'Content-Type': 'text/plain'});
      var n = 1, chk=5*1024, t=getTime();
      res.write(E.toString(new Uint8Array(chk))); 

    It actually seems hanging few seconds before sending anything.


Avatar for Polypod @Polypod started