perf improvements for pid statisics