Skip to content

process: improve memoryUsage() performance

Creating an object in JS and using a typed array to transfer values from C++ to JS is faster than creating an object and setting properties in C++.

The included benchmark shows ~34% increase in performance with this change:

                                 improvement confidence      p.value
 process/memoryUsage.js n=100000     34.39 %        *** 1.728171e-43

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

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)
  • process

Merge request reports

Loading