Skip to content

Conversation

@cloverhearts
Copy link
Member

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

  • removed call to function in template.
  • 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

After optimization.

performance01

Questions:

  • Does the licenses files need update? no
  • Is there breaking changes for older versions? no
  • Does this needs documentation? no

@cloverhearts
Copy link
Member Author

ci trigger.

@cloverhearts cloverhearts reopened this Aug 2, 2016
@cloverhearts
Copy link
Member Author

please, remove to browser cache

$scope.isParagraphSaveAlready = true;
$scope.startSaveTimer();
var cursorValue = $scope.editor.getCursorPosition();
if (cursorValue.row === 0 && cursorValue <= 30) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK here, in case it's the first row (like %something.somethig-else) we change paragraph mode.
But why do we check cursorValue <= 30 ?

@bzz
Copy link
Member

bzz commented Aug 2, 2016

Would it make sense to change isParagraphSaveAlready => wasParagraphAlreadySaved ?

@cloverhearts
Copy link
Member Author

@bzz Thank you for your feedback.
i will check to your opinion.
Thank you

@corneadoug
Copy link
Contributor

corneadoug commented Aug 2, 2016

I would limit this PR to the first commit, for me the rest is out of scope.
Also, in the first PR, there is no need to make a if before calling setParagraphMode, the conditions you added are already at the beginning of the function.

$scope.setParagraphMode can also be changed to var setParagraphMode

@cloverhearts cloverhearts changed the title [ ZEPPELIN-1266 ] Code editor Optimization [ ZEPPELIN-1266 ] Code editor Optimization and Paragraph render logic Optimization Aug 2, 2016
@cloverhearts cloverhearts changed the title [ ZEPPELIN-1266 ] Code editor Optimization and Paragraph render logic Optimization [ ZEPPELIN-1266 ] Code editor Optimization Aug 3, 2016
@cloverhearts
Copy link
Member Author

cloverhearts commented Aug 3, 2016

@corneadoug
I did modification.
Please review for this pr.
Thank you.

$timeout(function() {
$scope.setParagraphMode($scope.editor.getSession(), $scope.dirtyText, $scope.editor.getCursorPosition());
});
var setParagraphMode = $scope.setParagraphMode;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not calling directly the function here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@corneadoug
I seem to have misunderstood your say.
Modification was completed.
Thank you.

@cloverhearts
Copy link
Member Author

@bzz
I removed the parts which you say.
Thank you.

@bzz
Copy link
Member

bzz commented Aug 3, 2016

Looks great to me!

@corneadoug
Copy link
Contributor

@cloverhearts Thanks for the changes and keeping this PR focused.
I saw some great improvements with big Notebook with those changes.
@Leemoonsoo Can you try it too and tell us if you also think its better?

@minahlee
Copy link
Member

minahlee commented Aug 5, 2016

Merge if there is no further discussion

asfgit pushed a commit that referenced this pull request Aug 5, 2016
### 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 <cloverheartsdev@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

(cherry picked from commit adf3355)
Signed-off-by: Mina Lee <minalee@apache.org>
@asfgit asfgit closed this in adf3355 Aug 5, 2016
PhilippGrulich pushed a commit to SWC-SENSE/zeppelin that referenced this pull request Aug 8, 2016
### 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 <cloverheartsdev@gmail.com>

Closes apache#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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants