Commit 0cb5749
committed
Optimize load() by avoiding redundant hash checks and unpacking
Pooch by default revalidates file hashes and re-unpacks archives on
every call, which is very slow for large checkpoints. This change
introduces a `.checked` marker file that stores the resolved resource
path once verification succeeds. Subsequent calls reuse this cached path
instead of repeating the expensive validation and extraction steps.
Key changes:
- Use a `.checked` file alongside the cached resource to record the
verified path.
- Load from the `.checked` file if it exists, bypassing re-validation.
- Ensure `.checked` is written after successful retrieval/unpacking.
Signed-off-by: Anton Vorontsov <avorontsov@nvidia.com>1 parent 0d30652 commit 0cb5749
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
198 | 208 | | |
199 | 209 | | |
200 | | - | |
| 210 | + | |
201 | 211 | | |
202 | 212 | | |
203 | 213 | | |
| |||
207 | 217 | | |
208 | 218 | | |
209 | 219 | | |
210 | | - | |
211 | | - | |
| 220 | + | |
212 | 221 | | |
213 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
214 | 226 | | |
215 | 227 | | |
216 | 228 | | |
| |||
0 commit comments