Skip to content

Commit 76be22f

Browse files
Merge pull request #84 from supervoidcoder/performance-opti
Significant performance improvements! On the GitHub actions runners each run used to be about 20-25 ms. Now it's all the way down to 12-15 ms! However, that isn't the biggest thing here. In fact, 20-25 ms is already basically instant. The real sink was when you have a really massive tree. When making a tree that was around 100 levels deep, the program significantly slowed down, so it was directly correlated, being O(n^2). The 100-level deep tree was 230-300 ms. Now, instead of using process32 next in nested loops, I just made it into an unordered map. This immediately sped up the program back down to around 20-30 ms even for that big tree. Given that, well, no one will probably ever have a process tree that is _that_ long. But this was a fun optimization nonetheless. Funnily enough, the original witr (written in Go) is really slow, taking over a second for most queries. So this is pretty cool!
2 parents f7450eb + 44fa1da commit 76be22f

1 file changed

Lines changed: 224 additions & 193 deletions

File tree

0 commit comments

Comments
 (0)