Commit 6ab7443
perf(benchmarks): cache schema validators with lru_cache
The _validator function re-reads and re-checks the schema file on every
call. With 219 task.toml files and multiple schema validations per task,
this causes unnecessary I/O and computation.
Add lru_cache(maxsize=16) to _validator — there are only a handful of
schemas, so the cache hit rate is near 100%.1 parent 6536175 commit 6ab7443
1 file changed
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
48 | 50 | | |
49 | 51 | | |
50 | 52 | | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
0 commit comments