Perf: Send 'ipcReady' as soon as possible

This slightly improves app startup time
This commit is contained in:
Feross Aboukhadijeh
2016-05-11 22:25:36 +02:00
parent 93252d430e
commit ed46583226

View File

@@ -45,6 +45,9 @@ var vdomLoop
// Not global JS exceptions, not like Rollbar, handles segfaults/core dumps only
crashReporter.init()
// Listen for messages from the main process
setupIpc()
// All state lives in state.js. `state.saved` is read from and written to a file.
// All other state is ephemeral. First we load state.saved then initialize the app.
loadState(init)
@@ -94,9 +97,6 @@ function init () {
window.addEventListener('focus', onFocus)
window.addEventListener('blur', onBlur)
// Listen for messages from the main process
setupIpc()
// Done! Ideally we want to get here <100ms after the user clicks the app
sound.play('STARTUP')