Optimizing problem stats with caching and streaming