         xhr.send JSON.stringify(data)
         window.lastError = exception
 
+# Waits for the DOM to be ready
 window.onload = ->
 
     try
         window.__DEV__ = window.location.hostname is 'localhost'
 
-        # expose an APi for performance
-        # performance is not defined in phantomJS
-        referencePoint = 0
-        window.start = ->
-            referencePoint = performance.now() if performance?.now?
-            React.addons.Perf.start()
-        window.stop = ->
-            console.log performance.now() - referencePoint if performance?.now?
-            React.addons.Perf.stop()
-        window.printWasted = ->
-            stop()
-            React.addons.Perf.printWasted()
-        window.printInclusive = ->
-            stop()
-            React.addons.Perf.printInclusive()
-        window.printExclusive = ->
-            stop()
-            React.addons.Perf.printExclusive()
+        initPerformances()
 
         # expose an API
         window.cozyMails = require './utils/api_utils'

# Waits for the DOM to be ready
# Send client side errors to server
window.onerror = (msg, url, line, col, error) ->
    console.error msg, url, line, col, error, error?.stack

        window.cozyMails.setSetting 'plugins', window.settings.plugins

        # Init Web Intents
        initIntent()

        # Flux initialization (must be called at the begining)
        AccountStore  = require './stores/account_store'
