You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mi...@apache.org on 2016/08/05 03:11:37 UTC

zeppelin git commit: [ ZEPPELIN-1266 ] Code editor Optimization

Repository: zeppelin
Updated Branches:
  refs/heads/master a922fd28c -> adf335587


[ ZEPPELIN-1266 ] Code editor Optimization

### What is this PR for?
If the result of many para- graph, the code editor is very slow.

### What type of PR is it?
Improvement

### Todos
- [x] removed call to function in template.
- [x] changed event (aceChange event to ace input event)

### What is the Jira issue?
https://issues.apache.org/jira/browse/ZEPPELIN-1266

### How should this be tested?
1. going to r tutorial notebook.
2. write to paragraph on anyway. (many many.. fast.. fast typing.)

### Screenshots (if appropriate)
#### Before optimization.
![performance02](https://cloud.githubusercontent.com/assets/10525473/17323111/a1cd9b2e-58db-11e6-8d61-7ab98ea96b3a.gif)

#### After optimization.
![performance01](https://cloud.githubusercontent.com/assets/10525473/17323107/a02b5338-58db-11e6-95c8-543aab7131dd.gif)

### Questions:
* Does the licenses files need update? no
* Is there breaking changes for older versions? no
* Does this needs documentation? no

Author: CloverHearts <cl...@gmail.com>

Closes #1258 from cloverhearts/dev/aceeditorperformance and squashes the following commits:

2bde378 [CloverHearts] removed local variable setParagarphmode to global variable for code editor optimization.
9e2c7fc [CloverHearts] restore to aceChanged function for code editor optimization
86ba5c4 [CloverHearts] ace editor performance up


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/adf33558
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/adf33558
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/adf33558

Branch: refs/heads/master
Commit: adf33558779662bd49b27b38afe8287e9f61cb4e
Parents: a922fd2
Author: CloverHearts <cl...@gmail.com>
Authored: Wed Aug 3 14:13:14 2016 +0900
Committer: Mina Lee <mi...@apache.org>
Committed: Fri Aug 5 12:11:28 2016 +0900

----------------------------------------------------------------------
 .../src/app/notebook/paragraph/paragraph.controller.js         | 6 ++----
 zeppelin-web/src/app/notebook/paragraph/paragraph.html         | 1 -
 2 files changed, 2 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/adf33558/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
index 1d672e7..e3f15e3 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.controller.js
@@ -523,10 +523,7 @@ angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
   $scope.aceChanged = function() {
     $scope.dirtyText = $scope.editor.getSession().getValue();
     $scope.startSaveTimer();
-
-    $timeout(function() {
-      $scope.setParagraphMode($scope.editor.getSession(), $scope.dirtyText, $scope.editor.getCursorPosition());
-    });
+    $scope.setParagraphMode($scope.editor.getSession(), $scope.dirtyText, $scope.editor.getCursorPosition());
   };
 
   $scope.aceLoaded = function(_editor) {
@@ -535,6 +532,7 @@ angular.module('zeppelinWebApp').controller('ParagraphCtrl', function($scope, $r
 
     _editor.$blockScrolling = Infinity;
     $scope.editor = _editor;
+    $scope.editor.on('input', $scope.aceChanged);
     if (_editor.container.id !== '{{paragraph.id}}_editor') {
       $scope.editor.renderer.setShowGutter($scope.paragraph.config.lineNumbers);
       $scope.editor.setShowFoldWidgets(false);

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/adf33558/zeppelin-web/src/app/notebook/paragraph/paragraph.html
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/app/notebook/paragraph/paragraph.html b/zeppelin-web/src/app/notebook/paragraph/paragraph.html
index 9b8f17d..60ba6a6 100644
--- a/zeppelin-web/src/app/notebook/paragraph/paragraph.html
+++ b/zeppelin-web/src/app/notebook/paragraph/paragraph.html
@@ -41,7 +41,6 @@ limitations under the License.
            class="editor"
            ui-ace="{
                      onLoad : aceLoaded,
-                     onChange: aceChanged,
                      require : ['ace/ext/language_tools']
                    }"
            ng-model="paragraph.text"