Alexandre Moureaux
almouro.bsky.social
Alexandre Moureaux
@almouro.bsky.social
Love talking about #performance in #AndroidDev #ReactNative #Flutter
Created https://flashlight.dev 🔦

Also Christian ✝️, guinea pig lover 🐹, medieval history enthusiast 🏰
It's an old version of a "box" from french provider Orange

To be honest, I was surprised the app was still running knowing how bad the device was 😅
December 3, 2024 at 2:55 PM
It's a challenge 😅
I find it quite fun actually, but it's tough nonetheless
December 3, 2024 at 2:54 PM
When you optimize, you can easily use it to compare perf before and after the fix!

flashlight test --bundleId xyz.blueskyweb.app --testCommand "adb shell input swipe 500 1200 500 200 50" --iterationCount 1 --duration 5000 --record --skipRestart

flashlight report before.json after.json
November 19, 2024 at 9:44 AM
... UI/render thread would be even higher with a video playing (there was none in my test)

FlashList does make it much easier to optimize but indeed it adds recycling. Maybe the new list by @jayz.us would be an easier React-idiomatic option 🤞

My full flashlight command if anyone is curious:
November 19, 2024 at 9:44 AM
... we still keep 11 screens of posts in the hierarchy 🤔

No time to dig more atm, but I'd venture the large number of elements displayed by the list is responsible for the impact on JS thread, and in turn on the UI thread as well (and so on FPS).
Should be checkable in the React DevTools 🤞

UI/ ...
November 19, 2024 at 9:44 AM
A quick flashlight test on a A10S with one quick scroll shows:

- HEAVY JS usage
to the point where the list goes blank quickly (after a post from @tazsingh.com 😅)
- high UI thread usage as well, causing FPS drops

FlatList are notoriously difficult to optimize, I see a windowSize={11}, meaning...
November 19, 2024 at 9:44 AM
Unrelated but I got this screen when I tried to reply 😅 @bsky.app
Reply did go through though it would seem

(Using pixel 8 Android 14)
November 14, 2024 at 2:35 PM
It gives a bit more details related to the frame times on the native side

High frame time would correlate to high UI thread and render thread CPU usage on Flashlight and also lower FPS

It doesn't give details on UI thread work outside of the frame rendering times though
November 14, 2024 at 2:33 PM
I see thanks! 🙏

Would it be possible to have native screens on Android as well? How complex do you think that would be to add in?
November 8, 2024 at 11:18 AM
Fantastic job! 👏👏

One of my biggest annoyances with big RN apps is:
Clicking on tabs is slow after the first time you go to a tab. Because React mounts the whole tab for the first time and blocks JS

Since the tabs are native now, does this mean we can have super fast performance as well? 🥹
November 8, 2024 at 9:56 AM
Haha Mr Performance, I like that name!
Danke schön Herr Kwast! ♥️
November 7, 2024 at 2:29 PM