our development Team stumbled above some performance issues after the switch from Ionic 3 to 4.
Some user interactions, that trigger animations, are now really slow and laggy. After some digging we found out, that the call
someelement.nativeElement.offsetLeft
and all the other offset Properties now costs round about 10x more time to get the value.
With the Chrome performance debugging we saw on the same line of code with ionic 3, a property read of about 0.8-0.9 ms and ported to Ionic 4 with about 9-10 ms. Whats going on, why is this under angular 6 so more time consuming?
Could you display some code to give more context and information?
I’ve now migrated my all app and for me it still look really smooth, but I may not manipulate the elements as you do etc., therefore would be cool to see a concrete code example.
Also I’ve got one parallax effect on native element which is still smooth on iOS, I’ve got a glitch with it on Android but that’s on me.
Assuming that this is just for reading the value and that you aren’t then using that value to modify something that would trigger a browser layout, see if running the read inside of Ionic’s DomController has any impact, e.g:
import { DomController } from '@ionic/angular';
this.domCtrl.read(() => {
//read value
});
The DomController batches DOM read/writes and executes them at the most opportune time to avoid layout thrashing.
It is a range slider with two interaction points. With Eventemiters we trigger some other animations, which then call this function above. I need to extract the slider code - so i can share it.
The Problem - the slider itself sets it’s new position and triggers a layout change. After that, the event triggers a bunch of layout changes and needs to get the new position of the slider, to align some items.
It wasn’t perfect, but know - the calculation where the items needs to go are more time consuming in resulting in low fps on some older devices.
On the browser without slowdown, this isn’t a issue. Except for the Edge Browser - there it is terrible too.
have you been able to reproduce the same behavior (= slower performance) in a dummies apps (one v3 and one v4)?
if yes that could be a great thing to submit an issue, sure the team would love to improve the performance
if no (if you were not able to reproduce the same behavior in a dummy app), then there is something else lowering the performance in your app itself
p.s.: when you do your test, do you try multiple times and are you sure everything is loaded? maybe because of lazy loading while you test not everything is there yet
Ok, the performance decrease was coming from a terrible scss import, of big fonts and other stuff in our variables.scss. The styling recalculation, therefore took a long time and resulting in slow fps on all user interactions.
With some tweeks we have now gained more fps, so it’s better than before.
Thank you for your help and inputs. In the future we will keep the DomController in mind.
I have the similar issue.
In iOS and Browser the performance is OK
But In Android The performance is too slow after switching 3 to 4.
I have a view with 4 tab Childs that includes ion-lis of cards.
The ion-list’s scroll and tab switching is too slow.
And the more modal popup in the tab child view work not good.
I need to touch the row two or three times to popup modal custom view.
And one more , in android modal popup up break tab child’s scrollable-view(ion-scroll). so I changed it to infinite loop.
But in IOS ion-scroll and modal popup woks fine…
I’m having the same problem here. I don’t know if it’s an issue with RAM, but when I increase it on virtual machines, it works better. Thought on my own personal phone (android) it’s still very slow.
If there’s any new update about it, please let us know.
We don’t have much SCSS styles, just some simple component styling.
The only “special” thing in scss is a custom font face, imported in variables.scss (ttfs).
On ios, everything is smooth, you can’t tell it’s a web based app.
+1. I am also experiencing much slower performance with user interaction on Android devices. Angular navigation Sometimes takes up to 1000ms to execute, and the slowness has been pointed out by end users.