-
Notifications
You must be signed in to change notification settings - Fork 46
Massive lag with ListViews #345
Comments
Hi, The problem is each time you add to the data source the whole list invalidates which is an expensive operation. One way around this is: list.dataSource.removeAll();
list.dataSource.allowEvents = false;
for (i in item) {
list.dataSource.add(i);
}
list.dataSource.allowEvents = true; That should stop all the invalidations and speed things up considerably. The data source emitting events isnt the best design and i dont think it will come over to V2, at least not in the way it works currently. As for you docs, im afraid the docs are pretty poor... Simply put i dont have time to rectify it either :( |
That's actually the first thing I tried, setting them to false works, but setting them back true throws an error
This is using the latest git version. |
Thats very strange. If you have time and can create a minimal sample, especially one that shows that error, then it will be easier to help work out whats going one. Ive used that |
I was able to fix it using:
This works for now I guess, I'm guessing I've broken it since I've just been hacking stuff together. |
This is more of a question than an issue as I'm likely simply doing something wrong. I'm trying to make a list of periodically updating text values in a ListView, a list in which I sometime need to completely change to new data. I'm doing this as:
Where c.dsEntry is an object containing only a .text property be updated.
Also, individual objects don't update automatically, after updating each tick my "data source objects" I must also dispatch:
Although this isn't very relevant.
The removeAll/add stage is incredibly slow often taking 7+ seconds only removing/adding 100 objects total, what am I doing wrong? The call stack showing the lag is here
Is there a better place for me to learn haxeui than here? The lack of documentation makes it almost impossible to learn, unless you're an expert in a similar API I presume. And I'm not seeing any forums or IRC channels.
The text was updated successfully, but these errors were encountered: