process walker perfs: optimize readLimits and readStats #2461
Labels
chore
Related to fix/refinement/improvement of end user or new/existing developer functionality
performance
Excessive resource usage and latency; usually a bug or chore
I am testing Scope with a load of 100 processes running my openfiles program, so that should generate 50.000 opened files.
I get the following pprof data:
For the proc walker, that's:
There is room for improving the string parsing. For readStats, I wrote an alternative implementation of the parser: https://gist.github.com/alban/7bdf6ced1352d8efbc6c22a64eabe7e3 and I get the following improvements:
I initially tried with
fmt.Sscanf
but unfortunately, the performance was bad. My new implementation follows the pattern explained on http://stackoverflow.com/questions/31333353/faster-input-scanningThe text was updated successfully, but these errors were encountered: