Import numpy, pivideostream in background
What changed, and why it matters
This commit is a performance optimization, not a security fix. It moves two slow-to-load software modules (numpy and pivideostream) so they start loading in the background while the user is still seeing the startup screen. This makes the device feel faster but does not change what the software does or how it protects data.
No security action needed. Review as a normal performance/refactoring change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff adds two background import calls to an existing BackgroundImportThread and replaces a commented-out print with a logger.debug statement. The imports are already used elsewhere in the application; this change only preloads them earlier to reduce perceived startup latency. No security boundaries, cryptographic operations, input handling, or access controls are modified.
Changed components
src/seedsigner/controller.pyInspect captured patch +4 / −1
diff --git a/src/seedsigner/controller.py b/src/seedsigner/controller.py
index 5141723..0107081 100644
--- a/src/seedsigner/controller.py
+++ b/src/seedsigner/controller.py
@@ -60,7 +60,7 @@ class BackgroundImportThread(BaseThread):
def time_import(module_name):
last = time.time()
import_module(module_name)
- # print(time.time() - last, module_name)
+ logger.debug(f"{time.time() - last:0.4f}: {module_name}")
time_import('embit')
time_import('seedsigner.helpers.embit_utils')
@@ -70,6 +70,9 @@ class BackgroundImportThread(BaseThread):
from seedsigner.models.seed_storage import SeedStorage
Controller.get_instance()._storage = SeedStorage()
+ time_import('numpy') # used by PiVideoStream; by far the slowest import (2.29s)
+ time_import('seedsigner.hardware.pivideostream')
+
# Get MainMenuView ready to respond quickly
time_import('seedsigner.views.scan_views')
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.