commit eba97f74b41b0e647aaf600f7cdd3bf643a40fee
parent 4d62963efe79d2224a5a273b3eaac207def68a7b
Author: SomberNight <somber.night@protonmail.com>
Date: Fri, 16 Nov 2018 14:39:22 +0100
decorate some methods with @profiler to debug slow startup
Diffstat:
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/electrum/daemon.py b/electrum/daemon.py
@@ -37,7 +37,7 @@ from .jsonrpc import VerifyingJSONRPCServer
from .version import ELECTRUM_VERSION
from .network import Network
from .util import (json_decode, DaemonThread, print_error, to_string,
- create_and_start_event_loop)
+ create_and_start_event_loop, profiler)
from .wallet import Wallet, Abstract_Wallet
from .storage import WalletStorage
from .commands import known_commands, Commands
@@ -121,6 +121,7 @@ def get_rpc_credentials(config: SimpleConfig) -> Tuple[str, str]:
class Daemon(DaemonThread):
+ @profiler
def __init__(self, config: SimpleConfig, fd=None, *, listen_jsonrpc=True):
DaemonThread.__init__(self)
self.config = config
diff --git a/electrum/gui/qt/__init__.py b/electrum/gui/qt/__init__.py
@@ -43,7 +43,7 @@ from electrum.i18n import _, set_language
from electrum.plugin import run_hook
from electrum.storage import WalletStorage
from electrum.base_wizard import GoBack
-from electrum.util import (UserCancelled, PrintError,
+from electrum.util import (UserCancelled, PrintError, profiler,
WalletFileException, BitcoinException)
from .installwizard import InstallWizard
@@ -85,6 +85,7 @@ class QNetworkUpdatedSignalObject(QObject):
class ElectrumGui(PrintError):
+ @profiler
def __init__(self, config, daemon, plugins):
set_language(config.get('language'))
# Uncomment this call to verify objects are being properly
@@ -190,6 +191,7 @@ class ElectrumGui(PrintError):
self.network_updated_signal_obj)
self.nd.show()
+ @profiler
def create_window_for_wallet(self, wallet):
w = ElectrumWindow(self, wallet)
self.windows.append(w)