Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use lru_cache on costly validation function.
This gives a 24% speedup when downloading a folder with 30,000 small files using the CRT via CLI. When profiling this workload, `_validate_subscriber_methods()` had a big presence in the flame graph. Commenting out the validate function gave a huge speedup. But the validation is useful, so we didn't want to remove it. Using lru_cache provides the same speedup for the 30,000 file workload. It runs 6 times (once per subscriber class) instead of 180,000 times (6 times per file).
- Loading branch information