indexzero / ps-tree

MIT License
149 stars 29 forks source link

Improve performance #24

Closed simonepri closed 5 years ago

simonepri commented 6 years ago

Changes

The use of an array is not suited for the job. An hash set is far better. This PR drastically reduces the complexity of the algorithm from O(n^2) to O(n)

@nelsonic @indexzero @zixia @soyuka

simonepri commented 6 years ago

@nelsonic ?

simonepri commented 6 years ago

Closing in favour of https://github.com/simonepri/pidtree

nelsonic commented 6 years ago

@simonepri this PR looks great. โœ… Sorry I did not respond earlier, โŒ›๏ธ I do not have access to NPM to publish a new version of the package ๐Ÿšซ hence not wanting to give "false hope" that your changes would be published in a new version ... ๐Ÿ˜ž Good on you for taking matters into your own hands and with your own package. ๐Ÿ‘

simonepri commented 6 years ago

Hi @nelsonic, no problem. We discussed it here: https://github.com/indexzero/ps-tree/issues/30

indexzero commented 5 years ago

Cherry-picked into #35 โ€“ย sorry for the delay in getting back to you on all this good work @simonepri. If you'd like to discuss merging pidtree back into ps-tree please lmk.