Browse Source

decorate some methods with @profiler to debug slow startup

3.3.3.1
SomberNight 6 years ago
parent
commit
eba97f74b4
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 3
      electrum/daemon.py
  2. 4
      electrum/gui/qt/__init__.py

3
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

4
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)

Loading…
Cancel
Save