Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/190091

Change subject: vbench: add 500ms delay before starting profile; don't wait for 
init event
......................................................................

vbench: add 500ms delay before starting profile; don't wait for init event

* It's a bit silly to wait for the init event from VisualEditor when we are the
  ones that initialize it. So instead start the profile right before we
  activate VE.
* Add a 500ms pre-activation delay to buffer the VE trace from any document
  load handlers that may exist.

Change-Id: Ie61c1f041ab800064795bda6eec89fd3b967014e
---
M files/ve/vbench
1 file changed, 3 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/91/190091/1

diff --git a/files/ve/vbench b/files/ve/vbench
index bef19d6..53fe39e 100755
--- a/files/ve/vbench
+++ b/files/ve/vbench
@@ -71,19 +71,15 @@
 JS = '''
     window.onload = function () {
         mw.trackSubscribe( 'event.Edit', function ( topic, event ) {
-            switch ( event.action ) {
-            case 'init':
-                console.profile();
-                break;
-            case 'ready':
+            if ( event.action === 'ready' ) {
                 console.profileEnd();
-                break;
             }
         } );
         setTimeout( function () {
               localStorage.setItem( 've-beta-welcome-dialog', 1 );
+              console.profile();
               mw.libs.ve.onEditTabClick( { preventDefault: $.noop } );
-        }, 0 );
+        }, 500 );
     };
 '''
 

-- 
To view, visit https://gerrit.wikimedia.org/r/190091
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie61c1f041ab800064795bda6eec89fd3b967014e
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Ori.livneh <o...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to