djberg96 / sys-proctable

A cross-platform Ruby interface for gathering process information on your operating system
Apache License 2.0
150 stars 33 forks source link

[Darwin] Change strategy for single pid versus all pids #69

Closed NickLaMuro closed 6 years ago

NickLaMuro commented 6 years ago

Changes:

The new flow of this ternary in Sys::ProcTable.ps can be described as follows:

That said, the changes here have a very minimal impact to performance, if any.

Extracted from https://github.com/djberg96/sys-proctable/pull/65

djberg96 commented 6 years ago

@NickLaMuro Any chance you could update this for 1.2.x?

NickLaMuro commented 6 years ago

Yeah, I can take a look at doing this tomorrow, as well as seeing what it would take for the other operating systems.

NickLaMuro commented 6 years ago

@djberg96 Sorry for taking forever to get around to this. I spent a few minutes on this and I think I rebased it properly. That said, I really need to check to be sure, and not sure if the tests cover all cases.

NickLaMuro commented 6 years ago

So... benchmarks are not really showing much of a change with this (if anything, this is making it slower...), so unsure whether it is worth the effort. Will leave it up to you.

djberg96 commented 6 years ago

@NickLaMuro Alright, then I will go ahead and close it.