diff options
author | Rebecca Turner <me@re-becca.org> | 2015-09-29 02:23:42 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-10-01 19:11:09 +0300 |
commit | cf422179280dd6cf1db8fd1e4c302769c5068c46 (patch) | |
tree | 301c27937c3ec6182bcba229b28bd4f99717806f /lib/ls.js | |
parent | 0879682920c07ffdfa272a2ff1af972373486be2 (diff) |
logical-tree: Make it mutate to improve performance
The clone we were doing to save ourselves from mutation proved to be
excessively slow. While lodash is being updated to not have the
same scaling issues, it was determined that we weren't gaining
anything from not mutating here, so there was no reason to pay
even a lesser price.
PR-URL: https://github.com/npm/npm/pull/9803
Fixes: #8826
Diffstat (limited to 'lib/ls.js')
-rw-r--r-- | lib/ls.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -16,7 +16,7 @@ var color = require('ansicolors') var npa = require('npm-package-arg') var iferr = require('iferr') var npm = require('./npm.js') -var logicalTree = require('./install/logical-tree.js') +var mutateIntoLogicalTree = require('./install/mutate-into-logical-tree.js') var recalculateMetadata = require('./install/deps.js').recalculateMetadata var getPackageId = require('./install/get-package-id.js') @@ -61,7 +61,8 @@ var lsFromTree = ls.fromTree = function (dir, physicalTree, args, silent, cb) { }) } - var data = logicalTree.asReadInstalled(physicalTree) + var data = mutateIntoLogicalTree.asReadInstalled(physicalTree) + pruneNestedExtraneous(data) filterByEnv(data) var bfs = filterFound(bfsify(data), args) |