gyp: fix O(n^2) in dependency calculations.

With 1000 targets an O(n^2) in the dependency management starts to be
noticed. This patch takes a 0.2s function to 0.02s. The function is not
parallelized so this is a true 1% speedup.

Also commented on another *potential* performance problem with very
specific dependency graphs.

BUG=362075
R=scottmg@chromium.org

Review URL: https://codereview.chromium.org/234813003/
Patch from Daniel Bratell <bratell@opera.com>!


git-svn-id: http://gyp.googlecode.com/svn/trunk@1898 78cadc50-ecff-11dd-a971-7dbc132099af
1 file changed