Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make Query.query('exist') lookup faster by adding a filename cache
Add a cache for `exists` queries. Currently, `exists` calls `git ls-tree` and parses the result to check if a file exists. A single call takes around 20-30 ms. It only gets used by Makefile filters. Large Makefiles cause a filter to make hundreds of these calls, causing filter processing to take seconds. Statistics on 20 HTTP requests on /linux/v6.11.6/source/MAINTAINERS: without: with: avg 1160 843 median 951 790 75th perc 1289 861 95th perc 2452 1078 max 2874 1749 The cache is stored inside Query, of which there is one instance per request. We do not risk cache invalidation issues. About memory usage: on Linux v6.9.4, the cache is 12MB.
- Loading branch information