mirror of
https://github.com/SeedSigner/seedsigner.git
synced 2026-10-05 15:08:25 +00:00
Import numpy, pivideostream in background
This commit is contained in:
@@ -60,7 +60,7 @@ class BackgroundImportThread(BaseThread):
|
|||||||
def time_import(module_name):
|
def time_import(module_name):
|
||||||
last = time.time()
|
last = time.time()
|
||||||
import_module(module_name)
|
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('embit')
|
||||||
time_import('seedsigner.helpers.embit_utils')
|
time_import('seedsigner.helpers.embit_utils')
|
||||||
@@ -70,6 +70,9 @@ class BackgroundImportThread(BaseThread):
|
|||||||
from seedsigner.models.seed_storage import SeedStorage
|
from seedsigner.models.seed_storage import SeedStorage
|
||||||
Controller.get_instance()._storage = 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
|
# Get MainMenuView ready to respond quickly
|
||||||
time_import('seedsigner.views.scan_views')
|
time_import('seedsigner.views.scan_views')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user