Repository navigation
Commit ebd1c70
committed
Optimize memory backend path lookups
Avoid constructing pathlib Path objects when a memory backend key is already canonical POSIX text. OpenHCS hot paths repeatedly probe memory-backed artifacts with normalized keys, so the previous unconditional normalization added avoidable overhead across load/save/existence checks.
Also add a direct exists() implementation for the in-memory store so callers that only need key presence do not pay for exception-oriented file probing. The change is storage-local and preserves the existing normalization path for non-canonical strings and Path inputs.1 parent 6609400 commit ebd1c70
1 file changed
Lines changed: 21 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
40 | 53 | | |
41 | 54 | | |
42 | 55 | | |
| |||
50 | 63 | | |
51 | 64 | | |
52 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
53 | 69 | | |
54 | 70 | | |
55 | 71 | | |
| |||
363 | 379 | | |
364 | 380 | | |
365 | 381 | | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
366 | 386 | | |
367 | 387 | | |
368 | 388 | | |
| |||
0 commit comments