react-native-paper-dates icon indicating copy to clipboard operation
react-native-paper-dates copied to clipboard

Takes a while to load dates

Open favianca opened this issue 3 years ago • 14 comments

untitled I am using hermes and polyfill, at first I was using another locale but I changed it back to en but it doesn't seem to fix it. I also thought that it might be the emulator but I have tried on real devices and the problem is still there

favianca avatar Apr 05 '21 11:04 favianca

I was about to open an issue for that :sweat_smile:

This issue is very noticeable in lower-end devices such as iPhone 5s

Example with production bundle ezgif com-gif-maker (4)

Dev env ( It's taking more than 2s ) Screenshot from 2021-04-02 11-06-57

Is it really necessary to load 4 months at once? wouldn't be better to render only the current one?

brunohkbx avatar Apr 05 '21 18:04 brunohkbx

Interesting will be a nice case to improve performance since as far as I know I have tried almost every optimisation possible. I hope React Native Fabric will improve things...

Maybe we can indeed render less on low-end devices but we need to at least render 3 months because it will be too much white when scrolling else.

RichardLindhout avatar Apr 06 '21 20:04 RichardLindhout

@RichardLindhout how about rendering the current month in the first render and then render the other 3 right after?

I think we could try to wrap a function responsible for rendering the other 3 months with InteractionManager.runAfterInteractions

brunohkbx avatar Apr 06 '21 20:04 brunohkbx

@brunohkbx hm that is interesting but in my case I was not loading multiple months as it still load when I change to next month

favianca avatar Apr 07 '21 03:04 favianca

I think the rendering needs to te be faster as this will bite back when we scroll down

RichardLindhout avatar Apr 07 '21 18:04 RichardLindhout

Let's rewrite it in Flutter :-P

RichardLindhout avatar Apr 07 '21 18:04 RichardLindhout

Maybe we could detect the performance of the device and edit the amount of months loaded, because I also want fast scrolling so maybe it's a good idea to only 1 month on smaller screens

RichardLindhout avatar Apr 07 '21 18:04 RichardLindhout

Indeed we should not need to load 4 months at once, it also seems like the all 4 month are re-rendered when user scrolls while only new ones should reload

RichardLindhout avatar Apr 07 '21 19:04 RichardLindhout

I've improved some things in v0.4.5, I would also recommend using Hermes on Android.

RichardLindhout avatar Apr 07 '21 20:04 RichardLindhout

I am using Expo with Hermes (and polyfills) and still seeing very slow loading performance 🤷

kendallroth avatar Dec 08 '21 00:12 kendallroth

Is it only on my end, ,or does this continue to be an issue?

Jeandcc avatar Oct 02 '23 03:10 Jeandcc

Well still an issue for me..

AviadBag avatar Oct 13 '23 12:10 AviadBag

I think we could optimize using the native view / text directly. See https://github.com/callstack/react-native-paper/issues/4157 cc: @iM-GeeKy

RichardLindhout avatar Oct 26 '23 07:10 RichardLindhout