Commit 403e004
authored
⚡️ Speed up function
Here’s a faster and more memory-efficient version of your program.
**Optimization rationale:**
- Avoids the extra `Path` object creation and `.open()` call—using `open(event_path)` is faster for a single use.
- Reduces dependency usage by not involving `Path` unless file system path manipulation is needed.
- Leaves error handling as originally absent, maintaining original logic.
- Leaves `lru_cache` as is and all function/return types unchanged.
**Summary of change:**
Direct file open instead of through `Path`, removing unnecessary abstraction for a single read and reducing overhead. All logic and return values are identical.get_cached_gh_event_data by 31% in PR #371 (chore/error-on-missing-key-in-fork)1 parent 47969c6 commit 403e004
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
0 commit comments