zeppelin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject zeppelin git commit: [ ZEPPELIN-1559 ] Code Editor slow performance resolve of the many Notebooks
Date Wed, 19 Oct 2016 23:32:05 GMT
Repository: zeppelin
Updated Branches:
  refs/heads/master 26e67d5ae -> a3a2e4d34


[ ZEPPELIN-1559 ] Code Editor slow performance resolve of the many Notebooks

### What is this PR for?
Currently, if you have a Notebook large number of,
There is a sharp decrease in performance of the Code editor.
The number and Paragraph creation of the Notebook does not have a relationship.
We are should always use the Code editor of the same performance.

I had to print a Notebook list only if there is a request.
There was quite a lot of performance improvements.

### What type of PR is it?
Improvement

### Todos
- [x] - change Notebook list render logic

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

### How should this be tested?
1. Create a notebook over 1000. (tested 10,000)
   I've used script on this.  (important! please, backup for notebooks directory.)
```
#/bin/bash

idx="0"

while [ $idx -lt 1000 ] # notebooks count 1000
do
  mkdir $idx
  echo """
{
	\"paragraphs\": [
	{
		\"text\": \"fsdkljfowiejfowejfoiwefiowejfiojlkdsjfklsdjflkjsdflkjwlkjefewf\",
			\"dateUpdated\": \"Oct 13, 2016 5:02:44 PM\",
			\"config\": {
				\"colWidth\": 12.0,
			\"graph\": {
				\"mode\": \"table\",
			\"height\": 300.0,
			\"optionOpen\": false,
			\"keys\": [],
			\"values\": [],
			\"groups\": [],
			\"scatter\": {},
			\"map\": {
				\"baseMapType\": \"Streets\",
			\"isOnline\": true,
			\"pinCols\": []
	}
	},
		\"enabled\": true,
		\"editorMode\": \"ace/mode/scala\"
	},
		\"settings\": {
			\"params\": {},
		\"forms\": {}
	},
		\"apps\": [],
		\"jobName\": \"paragraph_1476345687682_-1459653828\",
		\"id\": \"20161013-170127_68316618\",
		\"dateCreated\": \"Oct 13, 2016 5:01:27 PM\",
		\"status\": \"READY\",
		\"progressUpdateIntervalMs\": 500
	}
	],
		\"name\": \""${idx}"\",
		\"id\": \""${idx}"\",
		\"angularObjects\": {
			\"2BZSC9D3G:shared_process\": [],
		\"2BXGWF5TF:shared_process\": [],
		\"2BYKTADMA:shared_process\": [],
		\"2BYFT9HTZ:shared_process\": [],
		\"2BXDTJMED:shared_process\": [],
		\"2BZHPZ6NS:shared_process\": [],
		\"2BYKRWYB3:shared_process\": [],
		\"2BZH2UAT4:shared_process\": [],
		\"2BZ38J35G:shared_process\": [],
		\"2BXJ2X464:shared_process\": [],
		\"2BYQ57ED9:shared_process\": [],
		\"2BXDSA2SN:shared_process\": [],
		\"2BWZCTD2B:shared_process\": [],
		\"2BWT81MNU:shared_process\": [],
		\"2BWA7ZTRD:shared_process\": [],
		\"2BXW6X5KN:shared_process\": [],
		\"2BVWDQPXH:shared_process\": [],
		\"2BZGAF8KG:shared_process\": []
},
	\"config\": {},
	\"info\": {}
	}
  """ > $idx/note.json

  idx=$[$idx+1]
done

```

2. zeppelin restart or refresh notebook.
3. Try coding in any notebook. (fast)

### Screenshots (if appropriate)
#### before ( 5000 notebooks)
![optimization_before_codeditor](https://cloud.githubusercontent.com/assets/10525473/19457150/f18845a0-94ff-11e6-876d-4386dbf1e7de.gif)

#### after ( 5000 notebooks)
![optimization_for_codeeidtor](https://cloud.githubusercontent.com/assets/10525473/19457184/1f7d5036-9500-11e6-8b0c-91b301641c73.gif)

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

Author: CloverHearts <cloverheartsdev@gmail.com>

Closes #1533 from cloverhearts/ZEPPELIN-1559-Notebook-broadcast-opti and squashes the following
commits:

bd58102 [CloverHearts] id Delete unused for navbar
14e88bb [CloverHearts] selectively modified to render the Notebook list.


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

Branch: refs/heads/master
Commit: a3a2e4d340d14f9d6c4c7c85dd16425714f442b2
Parents: 26e67d5
Author: CloverHearts <cloverheartsdev@gmail.com>
Authored: Tue Oct 18 22:12:51 2016 +0900
Committer: Lee moon soo <moon@apache.org>
Committed: Thu Oct 20 08:32:01 2016 +0900

----------------------------------------------------------------------
 .../src/components/navbar/navbar.controller.js        | 14 ++++++++++++++
 zeppelin-web/src/components/navbar/navbar.html        |  6 +++---
 2 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a3a2e4d3/zeppelin-web/src/components/navbar/navbar.controller.js
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/navbar/navbar.controller.js b/zeppelin-web/src/components/navbar/navbar.controller.js
index 7838a82..8586960 100644
--- a/zeppelin-web/src/components/navbar/navbar.controller.js
+++ b/zeppelin-web/src/components/navbar/navbar.controller.js
@@ -57,6 +57,7 @@
     }
 
     function initController() {
+      $scope.isDrawNavbarNotebookList = false;
       angular.element('#notebook-list').perfectScrollbar({suppressScrollX: true});
 
       angular.element(document).click(function() {
@@ -122,6 +123,19 @@
     $scope.$on('loginSuccess', function(event, param) {
       loadNotes();
     });
+
+    /*
+    ** Performance optimization for Browser Render.
+    */
+    angular.element(document).ready(function() {
+      angular.element('.notebook-list-dropdown').on('show.bs.dropdown', function() {
+        $scope.isDrawNavbarNotebookList = true;
+      });
+
+      angular.element('.notebook-list-dropdown').on('hide.bs.dropdown', function() {
+        $scope.isDrawNavbarNotebookList = false;
+      });
+    });
   }
 
 })();

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/a3a2e4d3/zeppelin-web/src/components/navbar/navbar.html
----------------------------------------------------------------------
diff --git a/zeppelin-web/src/components/navbar/navbar.html b/zeppelin-web/src/components/navbar/navbar.html
index c4de846..8851409 100644
--- a/zeppelin-web/src/components/navbar/navbar.html
+++ b/zeppelin-web/src/components/navbar/navbar.html
@@ -25,12 +25,12 @@ limitations under the License.
 
     <div class="collapse navbar-collapse" ng-controller="NavCtrl as navbar">
       <ul class="nav navbar-nav" ng-if="ticket">
-        <li class="dropdown" dropdown>
-          <a href="#" class="dropdown-toggle" dropdown-toggle>Notebook <span class="caret"></span></a>
+        <li class="dropdown notebook-list-dropdown" dropdown>
+          <a href="#" class="dropdown-toggle" data-toggle="dropdown" dropdown-toggle>Notebook
<span class="caret"></span></a>
           <ul class="dropdown-menu navbar-dropdown-maxHeight" role="menu">
             <li><a href="" data-toggle="modal" data-target="#noteNameModal"><i
class="fa fa-plus"></i> Create new note</a></li>
             <li class="divider"></li>
-            <div id="notebook-list" class="scrollbar-container">
+            <div id="notebook-list" class="scrollbar-container" ng-if="isDrawNavbarNotebookList">
               <li class="filter-names" ng-include="'components/filterNoteNames/filter-note-names.html'"></li>
               <li ng-repeat="note in navbar.notes.root.children | filter:query.q | orderBy:navbar.arrayOrderingSrv.notebookListOrdering
track by $index"
                   ng-class="{'active' : navbar.isActive(note.id)}" ng-include="'components/navbar/navbar-notebookList-elem.html'">


Mime
View raw message