Skip to content

Commit 3e4898d

Browse files
committed
perf: Optimize conflict detection via Redis & fix profiling silence
This commit pushes the Legacy In-Process Loader to its theoretical limit on CPython. 1. Redis-Accelerated Conflict Detection: - Replaced O(N) filesystem scanning (`glob`/`scandir`) with O(1) Redis Pipelining. - Implemented `_detect_conflicts_via_redis` to batch check dependency versions. - Reduced conflict detection time from ~2.3ms to ~0.09ms. 2. Profiling & Logging Hygiene: - Fixed `__init__` logic in `omnipkgLoader` to correctly respect `enable_profiling=False`. - Removed hardcoded raw `print()` statements from `_aggressive_module_cleanup`. - Updated `_profile_end` to enforce silence checks before printing. - Standard execution is now completely silent as intended. 3. Performance Verdict: - Legacy Loader swap time is now ~75-85ms. - Profiling confirms >90% of this latency is strictly CPython overhead (GC heap traversal + sys.modules dictionary resizing). - Logic overhead is now <10% (<8ms). - Further optimization requires Daemon mode (0.6ms).
1 parent 18cd830 commit 3e4898d

1 file changed

Lines changed: 385 additions & 215 deletions

File tree

0 commit comments

Comments
 (0)