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
{{ message }}
Repository navigation
Lazy-import urllib and pyautogui to cut about a second from cold start #163
Most of the cold start before the window appears is imports the first frame does not need.
Where
autoclicker/core/click_engine.py:16
autoclicker/core/updates.py (urllib.request at import)
docs/PERFORMANCE.md:26
Details
python -X importtime -c "import autoclicker.main": tkinter and PIL about 130 ms; import pyautogui 510 to 1147 ms (mouseinfo about 495 ms self time, pyscreeze 388 ms including pyrect -> doctest); autoclicker.core.updates -> urllib.request about 157 ms, although the update check runs 1.5 s after launch.
Impact
0.5 to 1 s added to every GUI launch and every headless CLI run.
Suggested fix
Import urllib.request inside the update-check function. Import pyautogui lazily in the click engine (first use) so the window appears first. See the pyautogui replacement issue for the longer-term fix.
Acceptance criteria
import autoclicker.main no longer imports urllib.request or pyautogui
Engine tests still patch autoclicker.core.click_engine.pyautogui successfully
How to run tests: make check (Git Bash) or tasks.bat lint, tasks.bat typecheck, tasks.bat test (cmd). Single test: python -m pytest tests/test_x.py::TestClass::test_name --no-cov
Related docs: CONTRIBUTING.md, docs/ARCHITECTURE.md
Filed by repo-audit/full-audit at 9968dc8. Severity: low. Effort: S. audit-key: performance|autoclicker/core/click_engine.py|import pyautogui
Activity