-
-
Notifications
You must be signed in to change notification settings - Fork 245
<ListView> is very slow comparing to NS Core #565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Does NativeScript-Vue implicitly render each ListView cell into a |
We're only rendering whatever is inside the I'd be curious to see your findings @tralves based on what @bradmartin suggested on Slack. I wonder if for some reason the patching doesn't work properly in some cases, and re-creates views. I'm also curious to know if this is specific to the latest version, or has it always been like this? I haven't had issues with the LV performance so far. In the app I'm working on, we have around 15 v-templates, and has been working fine, although not that many elements. |
@bradmartin suggestions on slack were not very conclusive. For some reason, the performance of the ListView in the NS-Vue project built on my machine was better than the one from the playground... ¯_(ツ)_/¯. Anyway, the problem is more noticeable on iOS, probably for the dynamic heights. Has anyone tested the projects in the playground? Do you see the same sluggish scroll? I also checked the native components tree and they were the same. No problem there. The next step is to check the patching and re-creation of views. The LV has always shown these issues since I started the project, almost 1 yr ago... |
@rigor789 I found that at So for some reason, the listview is not giving NS-Vue a view to be recycled. I am trying to figure out if the ListView templates are being set correctly, but as far as I can see, they are. Any ideas? |
It turns out that this is only reproducible on iOS with NS-Vue with multiple templates*:
I also tested reverting the commit ba4e994, but it didn't fix anything. So the error must be in the way the templates are passed to the UITableView when using NS-Vue... which doesn't make much sense... I am searching for more clues on the way the NS creates the native components, but right now I don't have any more ideas... *- I tested this by attaching |
I was curious as to whether the ListView was slow just because of the limits of on-the-fly reconciliation and re-rendering (regardless of UI renderer), so I ported it to React NativeScript. https://play.nativescript.org/?template=play-react&id=844mww&v=14 But... it scrolls pretty fast on iOS by my eyes 😅 |
thank you for the test, @shirakaba! You are right, it works fine on React NS... (I secretly wished it didn't because Vue is bae and then there would be more people looking into it 😛) |
I dont see that issue in my nativescript-collectionview plugin. At least I don't think I do... May be we can try to recreate the example with it and compare. I know I don't handle templates the same way |
I found the issue! (eee the PR above). For comparison of a before/after, see the updated playground app. The list on the right is patched with this fix. |
Thanks to everyone here helping me turning to the right direction. Peeking at @shirakaba's React implementation was key, though! |
We are locking this issue because it has been closed for more than 14 days. If the issue comes up again please open a new issue with additional details. |
Version
2.4.0
Reproduction link
https://play.nativescript.org/?template=play-vue&id=KhyRrD
Platform and OS info
iOS 12/13, Android 8/9, NS Playground
Steps to reproduce
Open the playground https://play.nativescript.org/?template=play-vue&id=KhyRrD.
This project has 2 listviews linked to the same dataset. The one on the right is more complex because it uses different
<v-template>
and a<GridLayout>
for some cells.Notice that the list view is sluggish, especially the right one.
What is expected?
The ListView should scroll smoothly.
I created an NS Core project with the same dataset and the same UI here: https://play.nativescript.org/?template=play-tsc&id=KkPYYX.
See how smooth it scrolls!
What is actually happening?
On NS-Vue, the ListView scroll is very sluggish compared to the NS Core ListView.
I tested on both Android and iOS devices. The same thing happens: NS Core is smooth, NS-Vue is slow.
The NS-Vue wrapper is doing something that kills the ListView performance. I will start looking at this issue, but I think I'll need the experts on this one.
The text was updated successfully, but these errors were encountered: