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

Performance Issue

Open weljoda opened this issue 5 years ago • 12 comments

Hi there. First of all thanks for this grate piece of work.

I'm using the editor in an admin tool for content manegement, where i use forms with multiple editors. Especially when the content manegers edit multiple languages, the form expands and there are quickly more than 10 editors on one site. This causes a huge performance issue, and all other components in the form act with very high latency.

Does someone has any idea where i can start looking to overcome this performance issue? Is there any setting to disable a heavy feature or anything else like that?

It's quite easy to reproduce:

  1. Open https://stackblitz.com/edit/angular-editor-wysiwyg?file=src%2Fapp%2Fapp.component.html
  2. and past these changes
<div class="container">
  <header class="header">
    <h1>AngularEditor</h1>
    <p>Native WYSIWYG editor for Angular 6+</p>    
  </header>
  
  <input type="checkbox" id="scales" name="Slow"
         checked>
    <angular-editor id ="1"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="2"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="3"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="4"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="5"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="6"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="7"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="8"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="9"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="10"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="11"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="12"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="13"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="14"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
    <angular-editor id ="15"[(ngModel)]="htmlContent" [config]="config"></angular-editor>
  <h5 class="html-header">HTML Output</h5>
  <div class="html">
    {{ htmlContent }}
  </div>
  <p>
NPM package is here:
  <a href="https://www.npmjs.com/package/@kolkov/angular-editor">https://www.npmjs.com/package/@kolkov/angular-editor</a>
  </p>
  GitHub repo is here:
  <a href="https://github.com/kolkov/angular-editor">https://github.com/kolkov/angular-editor</a>
</div>
  1. and hit the checkbox.

If you have a strong computer, paste some more editors

weljoda avatar Dec 17 '19 12:12 weljoda

Hi! Thanks for the reporting. Provide an repo on github please for reproduce this issue.

kolkov avatar Dec 18 '19 11:12 kolkov

Sry for my late answer. Here is the repo/fork where I edited the demo app:

https://github.com/weljoda/angular-editor

or

https://angular-editor-wysiwyg-cqi7ao.stackblitz.io

weljoda avatar Jan 21 '20 10:01 weljoda

Thanks for the repo, I will try to reproduce.

kolkov avatar Jan 21 '20 10:01 kolkov

I have faced this issue. Problem must be related with toolbar. If you enable and show only the toolbar of one editor (e.g, focused editor), performance issues are gone.

Have tested it with 100 different editors on same page. Hope this helps.

JRPequerul avatar Jun 02 '20 13:06 JRPequerul

Thanks!

kolkov avatar Jun 02 '20 14:06 kolkov

I am also facing this issue. Is there any solution to solve the performance issue?

swapsword avatar Oct 09 '20 12:10 swapsword

I am also facing this issue. Any info?

davidtyemnyak avatar Nov 20 '20 15:11 davidtyemnyak

Same, anyone figured it out ?

xdrago1 avatar Mar 30 '21 18:03 xdrago1

Same issue here, is related to toolbar.

jordim avatar Jul 14 '21 10:07 jordim

I have found a workaround for this. I generate a random ID for each instance of the editor component and the performance issue disappears.

    <angular-editor [id]="'editor' + randomId"
                    [formControl]="editorFormControl"
                    [maxlength]="10000"
                    [config]="editorConfig"
                    (paste)="onPaste($event)"
                    (ngModelChange)="doInput()" (blur)="doBlur()"></angular-editor>
    randomId = Math.floor(Math.random() * 100) + 1;

xdrago1 avatar Jul 14 '21 23:07 xdrago1

Hello there, How can i show/hide the toolbar dynamically on focus/blur the editors ? I have 7 angular-editor and each one has a different id, but the same [config] Thank you

hervememain avatar Sep 13 '21 09:09 hervememain

Same issue for me, the more editors I have on my page ( issues starting at 5+) the slower it is. Each editor has it's own ID already. When setting showToolbar to false everything loads fast.

With a bit of profiling, it seems that the AeSelectComponent is taking that much time. grafik

maxbauer avatar Feb 22 '24 19:02 maxbauer