You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚡️ Speed up function get_cached_gh_event_data by 31% in PR #371 (chore/error-on-missing-key-in-fork)
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.
0 commit comments