JoelBesada / activate-power-mode

Atom package - Activate POWER MODE to write your code in style.
MIT License
3.58k stars 422 forks source link

Editor lags with shake enabled. #203

Open Costinutz32 opened 8 years ago

Costinutz32 commented 8 years ago

On a 400 line index page, there are constant lags with the shake effect enabled. Leaving only particles enabled works just fine, but this ruins the purpose of the plugin.

System : Intel NUC 6i5 ( i5 6260U / Intel Iris 540 / 16GB DDR4 / 512 PCIE SSD ) Also, the cpu usage jumps to 60-70 when the shake effect occurs ( and Atom using 35-45% ) Thanks!

lexcast commented 8 years ago

try inserting in your stylesheet the following:

atom-text-editor::shadow,
atom-text-editor {
  transform: translate3d(0,0,0);
}
marcoms commented 8 years ago

Using the new will-change property might be better. https://developer.mozilla.org/en/docs/Web/CSS/will-change

atom-text-editor {
    will-change: transform;
}
lexcast commented 8 years ago

perhaps with this? top and left properties are what really changes on screen shake

atom-text-editor,
atom-text-editor::shadow {
    will-change: top, left;
}
marcoms commented 8 years ago

Ah in that case is there a reason why transform isn't being used? Setting top and left so frequently will thrash layout whereas transform only triggers compositing in Blink.