realm / realm-js

Realm is a mobile database: an alternative to SQLite & key-value stores
https://realm.io
Apache License 2.0
5.78k stars 575 forks source link

Flatlist scrollTo takes time proportional (-ish) to the index #4721

Open sdandois opened 2 years ago

sdandois commented 2 years ago

How frequently does the bug occur?

All the time

Description

If you pass a realm collection to a flatlist and then call the method scrollToIndex({ index }), the time that the scrolling takes to finish is longer when the index is higher.

For example, if I have a list with 20 000 elements and I want to scroll from 0 to element number 15 000, it will take around 20 seconds to finish rendering.

Stacktrace & log output

No response

Can you reproduce the bug?

Yes, always

Reproduction Steps

Check my example repo in theflatlist-bug branch: https://github.com/sdandois/RealmHermesSomeBug/tree/flatlist-bug.

yarn android to test

Version

10.20.0-beta.5

What SDK flavour are you using?

Local Database only

Are you using encryption?

No, not using encryption

Platform OS and version(s)

Android 9

Build environment

Which debugger for React Native: ..

Cocoapods version

No response

takameyer commented 2 years ago

@sdandois Thanks for reporting. We will look into it.