angular-elastic icon indicating copy to clipboard operation
angular-elastic copied to clipboard

Performance Improvement

Open tobigit opened this issue 11 years ago • 3 comments

Our customers see performance lags when typing very fast. I debugged the elastic code and saw that every key stroke fires the adjust-function 2 times! One time called by the model-watcher and second time by the "oninput"-event of the textarea.

To improve the performance I buffered the function-call of adjust:

var bufferedAdjust = null;
function adjust() {
    if( !bufferedAdjust ) {
      bufferedAdjust = $timeout(_adjust, 100);
      bufferedAdjust.then(function () {
        bufferedAdjust = null
      });
    }
}

function _adjust() {
 // here is the original adjust-function-code
...

tobigit avatar Dec 01 '14 12:12 tobigit

to investigate

monospaced avatar Feb 21 '15 11:02 monospaced

Any updates on this please?

prasad83 avatar Nov 16 '15 17:11 prasad83

We also experience performance issues when the user enters a lot of text and then types fast. The profiler points out that the adjust function takes long because of "getPropertyValue" which I suppose means reading styles values from the DOM. Is there a way to bypass that?

bildschirmfoto 2016-06-14 um 09 42 46

Zenkit avatar Jun 14 '16 07:06 Zenkit

Archiving repository.

monospaced avatar Sep 21 '22 12:09 monospaced