Some performance optimizations for stat fetching