Skip to content

util: general improvements to util.inspect

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • commit message follows commit guidelines
Affected core subsystem(s)

util

Description of change

A number of general code improvements to util.inspect that yield an average perf improvement between 5-10%.

  • Reduces number of binding calls
  • Restructures parts for improved readability and code flow
  • Elimination of some unnecessary branches
  • Reduction in the number of String.prototype.replace calls
  • Switch to using template strings where possible to reduce the number of concats

CI: https://ci.nodejs.org/job/node-test-pull-request/3176/

Merge request reports

Loading