Node.js v5.7.0 Release Brief - NodeSource

The NodeSource Blog

You have reached the beginning of time!

Node.js v5.7.0 Release Brief

This week’s stable release comes with a handful new features, as well as significant performance improvements in some areas.

As with all releases within major version lines, minor and patch upgrades should be drop-in replacements for previous versions.

Overview

Of a total of 111 commits:

  • 16 were documentation-only commits.
  • 18 only modify tests and 14 only affect internal tooling.
  • There was one floating v8 patch and one dependency update:

12 commits were tagged as semver-minor, adding new functionality and justifying the jump to v5.7.0:

  • [eb6d07327a] - (SEMVER-MINOR) buffer: add encoding parameter to fill() (Trevor Norris) #4935
  • [60d2048b6c] - (SEMVER-MINOR) buffer: properly retrieve binary length of needle (Trevor Norris) #4803
  • [4c67d74607] - (SEMVER-MINOR) buffer: allow encoding param to collapse (Trevor Norris) #4803
  • [ecc797600f] - (SEMVER-MINOR) child_process: add shell option to spawn() (cjihrig) #4598
  • [368c1d1098] - (SEMVER-MINOR) dgram: support dgram.send with multiple buffers (Matteo Collina) #4374
  • [275f6dbcbb] - (SEMVER-MINOR) doc: correct tlsSocket.getCipher() description (Brian White) #4995
  • [7e82a566b3] - (SEMVER-MINOR) http: allow async createConnection() (Brian White) #4638
  • [18d24e60c5] - (SEMVER-MINOR) net: add net.listening boolean property over a getter (José Moreira) #4743
  • [98907c716b] - (SEMVER-MINOR) repl: allow multiline function call (Zirak) #3823
  • [98596a94fa] - (SEMVER-MINOR) test: run v8 tests from node tree (Bryon Leung) #4704
  • [c3f8aab652] - (SEMVER-MINOR) tls: add getProtocol() to TLS sockets (Brian White) #4995
  • [d1cacb814f] - (SEMVER-MINOR) vm: introduce cachedData/produceCachedData (Fedor Indutny) #4777

The remaining significant commits are as follows:

  • [3a96fa0030] - async_wrap: add parent uid to init hook (Andreas Madsen) #4600
  • [4ef04c7c4c] - async_wrap: make uid the first argument in init (Andreas Madsen) #4600
  • [4afe801f90] - async_wrap: add uid to all asyncWrap hooks (Andreas Madsen) #4600
  • [edf8f8a7da] - benchmark: split path benchmarks (Brian White) #5123
  • [8d713d8d51] - benchmark: allow empty parameters (Brian White) #5123
  • [5fa4117bfc] - build: add a help message and removed a TODO. (Ojas Shirekar) #5080
  • [09bfb865af] - build: remove redundant TODO in configure (Ojas Shirekar) #5080
  • [3dfc11c516] - build: remove Makefile.build (Ojas Shirekar) #5080
  • [fc78d3d6a7] - build: skip msi build if WiX is not found (Tsarevich Dmitry) #5220
  • [356acb39d7] - build: treat aarch64 as arm64 (Johan Bergström) #5191
  • [3b83d42b4a] - build: fix build when python path contains spaces (Felix Becker) #4841
  • [9e6ad2d8ff] - child_process: fix data loss with readable event (Brian White) #5036
  • [efd6f68dce] - cluster: dont rely on this in fork (Igor Klopov) #5216
  • [df93d60caf] - console: apply null as this for util.format (Jackson Tian) #5222
  • [c397ba8fa3] - contextify: use offset/length from Uint8Array (Fedor Indutny) #4947
  • [3048ac0b57] - crypto: have fixed NodeBIOs return EOF (Adam Langley) #5105
  • [af074846f5] - debugger: remove unneeded callback check (Rich Trott) #5319
  • [7bac743f36] - debugger: assert test before accessing this.binding (Prince J Wesley) #5145
  • [18c94e5a8d] - deps: remove unnecessary files (Brian White) #5212
  • [35c3832994] - deps: sync with upstream c-ares/c-ares@4ef6817 (Fedor Indutny)
  • [127dd6275a] - Revert "deps: sync with upstream c-ares/c-ares@4ef6817" (Ben Noordhuis) #5199
  • [b4db31822f] - dgram: scope redeclared variables (Rich Trott) #4940
  • [b706b0c2c5] - http: remove old, confusing comment (Brian White) #5233
  • [ed36235248] - http: remove unnecessary check (Brian White) #5233
  • [411d813323] - http: do not emit upgrade on advertisement (Fedor Indutny) #4337
  • [bbc786b50f] - http,util: fix typos in comments (Alexander Makarenko) #5279
  • [a2d198c702] - net: use _server for internal book-keeping (Fedor Indutny) #5262
  • [9cee86e3e9] - node: set process._eventsCount to 0 on startup (Evan Lucas) #5208
  • [f2e4f621c5] - node: improve process.nextTick performance (Ruben Bridgewater) #5092
  • [1c6f927bd1] - path: fix input type checking regression (Brian White) #5244
  • [4dae8caf7a] - path: performance improvements on all platforms (Brian White) #5123
  • [46be1f4d0c] - querystring: improve escape() performance (Brian White) #5012
  • [27e323e8c1] - querystring: improve unescapeBuffer() performance (Brian White) #5012
  • [301023b2b4] - querystring: improve parse() performance (Brian White) #5012
  • [c551da8cb4] - repl: handle quotes within regexp literal (Prince J Wesley) #5117
  • [15091ccca2] - src: remove unnecessary check (Brian White) #5233
  • [830bb04d90] - src: remove TryCatch in MakeCallback (Trevor Norris) #4507
  • [7f22c8c8a6] - src: remove unused TickInfo::in_tick() (Trevor Norris) #4507
  • [406eb1f516] - src: remove unused of TickInfo::last_threw() (Trevor Norris) #4507
  • [bcec2fecbd] - src: add AsyncCallbackScope (Trevor Norris) #4507
  • [2cb1594279] - src: fix MakeCallback error handling (Trevor Norris) #4507
  • [8d6e679a90] - src,test,tools: modify for more stringent linting (Rich Trott) #5214
  • [7684b0fcdf] - stream: fix no data on partial decode (Brian White) #5226
  • [f706cb0189] - streams: 5% throughput gain when sending small chunks (Matteo Collina) #4354
  • [25513a473a] - string_decoder: fix performance regression (Brian White) #5134
  • [aed04b85c2] - tls: nullify .ssl on handle close (Fedor Indutny) #5168
  • [47274704aa] - url: fix lint and deopt issues (Brian White) #5300
  • [729ad75860] - url: improve url.parse() performance (Brian White) #4892
  • [6c8378b15b] - vm: fix produceCachedData (Jiho Choi) #5343

Notable Changes

  • buffer:
    • You can now supply an encoding argument when filling a Buffer Buffer#fill(string[, start[, end]][, encoding]), supplying an existing Buffer will also work with Buffer#fill(buffer[, start[, end]]). See the API documentation for details on how this works. (Trevor Norris) #4935
    • Buffer#indexOf() no longer requires a byteOffset argument if you also wish to specify an encoding: Buffer#indexOf(val[, byteOffset][, encoding]). (Trevor Norris) #4803
  • child_process: spawn() and spawnSync() now support a 'shell' option to allow for optional execution of the given command inside a shell. If set to true, cmd.exe will be used on Windows and /bin/sh elsewhere. A path to a custom shell can also be passed to override these defaults. On Windows, this option allows .bat. and .cmd files to be executed with spawn() and spawnSync(). (Colin Ihrig) #4598
  • http_parser: Update to http-parser 2.6.2 to fix an unintentionally strict limitation of allowable header characters (James M Snell) #5237
  • dgram: socket.send() now supports accepts an array of Buffers or Strings as the first argument. See the API docs for details on how this works. (Matteo Collina) #4374
  • http: Fix a bug where handling headers will mistakenly trigger an 'upgrade' event where the server is just advertising its protocols. This bug can prevent HTTP clients from communicating with HTTP/2 enabled servers. (Fedor Indutny) #4337
  • net: Added a listening Boolean property to net and http servers to indicate whether the server is listening for connections. (José Moreira) #4743
  • node: The C++ node::MakeCallback() API is now reentrant and calling it from inside another MakeCallback() call no longer causes the nextTick queue or Promises microtask queue to be processed out of order. (Trevor Norris) #4507
  • tls: Add a new tlsSocket.getProtocol() method to get the negotiated TLS protocol version of the current connection. (Brian White) #4995
  • vm: Introduce new 'produceCachedData' and 'cachedData' options to new vm.Script() to interact with V8's code cache. When a new vm.Script object is created with the 'produceCachedData' set to true a Buffer with V8's code cache data will be produced and stored in cachedData property of the returned object. This data in turn may be supplied back to another vm.Script() object with a 'cachedData' option if the supplied source is the same. Successfully executing a script from cached data can speed up instantiation time. See the API docs for details. (Fedor Indutny) #4777
  • performance: Significant improvements in:
    • process.nextTick() (Ruben Bridgewater) #5092
    • path module (Brian White) #5123
    • querystring module (Brian White) #5012
    • streams module when processing small chunks (Matteo Collina) #4354

Git Diffstats

(Showing the delta between v5.6.0 and v5.7.0, ignoring deps/npm.)

Without deps, docs, benchmarks, or tests:

 .eslintrc                              |  111 +-
 Makefile                               |   68 +-
 Makefile.build                         |  499 --------
 configure                              |    8 +-
 lib/_debug_agent.js                    |    2 +-
 lib/_debugger.js                       |    2 +-
 lib/_http_agent.js                     |  110 +-
 lib/_http_client.js                    |   42 +-
 lib/_http_common.js                    |   19 +
 lib/_http_incoming.js                  |    4 -
 lib/_http_outgoing.js                  |    3 +-
 lib/_http_server.js                    |    2 +-
 lib/_stream_readable.js                |   37 +-
 lib/_stream_writable.js                |   63 +-
 lib/_tls_wrap.js                       |   16 +-
 lib/buffer.js                          |   54 +-
 lib/child_process.js                   |   53 +-
 lib/cluster.js                         |    2 +-
 lib/console.js                         |    8 +-
 lib/dgram.js                           |  176 +--
 lib/internal/child_process.js          |    2 +-
 lib/net.js                             |   21 +-
 lib/path.js                            | 1969 ++++++++++++++++++++++--------
 lib/querystring.js                     |  302 +++--
 lib/repl.js                            |   21 +-
 lib/string_decoder.js                  |    5 +-
 lib/url.js                             |  575 ++++++---
 lib/util.js                            |    4 +-
 node.gyp                               |    2 +-
 src/async-wrap-inl.h                   |    9 +-
 src/async-wrap.cc                      |   53 +-
 src/env-inl.h                          |   32 +-
 src/env.cc                             |   22 +-
 src/env.h                              |   26 +-
 src/node.cc                            |   51 +-
 src/node.js                            |  122 +-
 src/node_buffer.cc                     |   83 +-
 src/node_contextify.cc                 |   85 +-
 src/node_crypto.cc                     |   36 +-
 src/node_crypto.h                      |    1 +
 src/node_crypto_bio.cc                 |   16 +
 src/node_crypto_bio.h                  |    4 +
 src/node_http_parser.cc                |    4 +-
 src/node_internals.h                   |    2 -
 src/node_version.h                     |    2 +-
 src/udp_wrap.cc                        |   64 +-
 src/util.cc                            |   23 +
 src/util.h                             |   27 +
 tools/doc/addon-verify.js              |    3 +-
 tools/doc/html.js                      |   19 +-
 tools/doc/type-parser.js               |   59 +
 tools/eslint-rules/new-with-error.js   |    5 -
 tools/eslint-rules/require-buffer.js   |   19 +-
 tools/eslint-rules/required-modules.js |    5 -
 tools/make-v8.sh                       |   38 +
 vcbuild.bat                            |    2 +-
 56 files changed, 3178 insertions(+), 1814 deletions(-)

Deps only:

 deps/http_parser/Makefile                         |    4 +-
 deps/http_parser/http_parser.c                    |    2 +-
 deps/http_parser/http_parser.h                    |    2 +-
 deps/http_parser/test.c                           |    2 +-
 deps/v8/src/compiler/ppc/code-generator-ppc.cc    |   62 +-
 deps/v8/test/mjsunit/tools/profviz-test.log       | 2613 +++++++++++++++++++
 .../tools/tickprocessor-test-func-info.log        |   11 +
 deps/v8/test/mjsunit/tools/tickprocessor-test.log |   25 +
 8 files changed, 2685 insertions(+), 36 deletions(-)

Docs only:

 CHANGELOG.md                   | 135 +++++++++++++++++++++
 COLLABORATOR_GUIDE.md          |  16 +--
 CONTRIBUTING.md                |  31 +++--
 GOVERNANCE.md                  |  85 +++++++-------
 README.md                      |   8 +-
 WORKING_GROUPS.md              |  16 +--
 doc/api/buffer.markdown        |  35 ++++--
 doc/api/child_process.markdown |  47 +++++---
 doc/api/cluster.markdown       |  18 +--
 doc/api/console.markdown       |  37 +++---
 doc/api/crypto.markdown        |  37 +++---
 doc/api/dgram.markdown         |  74 +++++++-----
 doc/api/domain.markdown        |   4 +-
 doc/api/fs.markdown            |  14 +--
 doc/api/http.markdown          |  52 +++++++++
 doc/api/modules.markdown       |   2 +-
 doc/api/net.markdown           |  19 +--
 doc/api/process.markdown       |   6 +
 doc/api/repl.markdown          |   6 +-
 doc/api/stream.markdown        |  29 ++---
 doc/api/tls.markdown           |  25 +++-
 doc/api/vm.markdown            |   9 ++
 doc/api_assets/style.css       | 246 +++++++++++++++++++--------------------
 doc/template.html              |  12 +-
 24 files changed, 613 insertions(+), 350 deletions(-)

Tests & Benchmarks only:

   5.4% benchmark/dgram/
   3.0% benchmark/net/
  21.3% benchmark/path/
   1.3% benchmark/querystring/
   0.4% benchmark/
   6.0% test/addons/make-callback-recurse/
   0.7% test/message/
  59.0% test/parallel/
   2.0% test/sequential/
   0.4% test/
 117 files changed, 2925 insertions(+), 807 deletions(-)

Most active commit

Of the 111 commits, 4dae8ca was the most active:
(Excluding docs, npm, eslint, and tests.)

commit 4dae8caf7adedc12f00b90d118b9cad407895db6
Author: Brian White <mscdex@mscdex.net>
Date:   Fri Feb 5 22:57:35 2016 -0500

    path: performance improvements on all platforms

    This commit significantly improves performance of all path functions.

    Optimization strategies include:
    * Replacing regexps with manual parsers
    * Avoiding unnecessary array creation (including split() + join())
    * Returning earlier where possible to avoid unnecessary work
    * Minimize unnecessary string creation and concatenations
    * Combining string iterations

    PR-URL: https://github.com/nodejs/node/pull/5123
    Reviewed-By: Roman Reiss <me@silverwind.io>
    Reviewed-By: James M Snell <jasnell@gmail.com>

 lib/path.js                             | 1941 ++++++++++++++++++++++-------
 test/parallel/test-path-parse-format.js |    4 -
 2 files changed, 1466 insertions(+), 479 deletions(-)

This is a regular and routine release for a Node.js stable release line. We will be sure to let you know when a release contains a critical update and a recommendation to upgrade. Of course, we'd love you to upgrade, but this release is not critical unless you are experiencing one of the issues identified and fixed above.

The NodeSource platform offers a high-definition view of the performance, security and behavior of Node.js applications and functions.

Start for Free