-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
๐ Context
As ThreadFactory grows, top-level imports might eventually introduce too much overhead during startup โ especially as we add more primitives, pools, or utility layers.
๐ Plan
When (or if) import time becomes a performance problem:
- Use PEP 562 getattr inside init.py to enable lazy loading of top-level API symbols.
- Keeps usage like
from thread_factory import ConcurrentQueueintact. - Defers the cost of loading modules until they're actually needed.
- Keeps usage like
โ๏ธ Optional Enhancement
Introduce a meta dictionary at the top level to store:
- Internal debug flags
- No-GIL detection state
- Runtime switches or feature toggles
This keeps internals clean without polluting the public API.
๐ฎ Example Future Use
Inside thread_factory/init.py:
meta = {
"debug_mode": True,
"nogil_detected": False,
}
๐ค Assigned to
๐ง Me (a future me who's debugging startup lag)
๐บ Priority
Medium โ Hold off until DynamicPool or other runtime systems are added.
Metadata
Metadata
Assignees
Labels
No labels