Android Question xCustomListView Optimize Speed

scsjc

Well-Known Member
Licensed User
Longtime User
Hi all,

Until now I used SearchView to load a list of clients, and select the client and the performance was pretty good.

Today I have been "playing" with the new available options ... "xCustomListView" and also with "CLVIndexScroller", well the performance is not so good, and the speed is slow in loading. (I removed "CLVIndexScroller" to see if it was the fault of this code, and I do not notice any difference either.

I would like to know if anyone can tell me some way to optimize this code that I attached to speed up the visualization process.


Thank you very much to all.

upload_2019-7-5_22-6-46.png
 

Attachments

  • xCustomListView Speed.zip
    16 KB · Views: 286

Peter Simpson

Expert
Licensed User
Longtime User
Hello @scsjc,
I have 2 questions for you.

  1. Why do you need to load 7089 items into the list at once, there's no need for that?
  2. Why are you not using lazy loading https://www.b4x.com/android/forum/t...ew-lazy-loading-virtualization.87930/#content?
I'm just wondering as nobody ever needs to scrool down 7k+ items. You might be better of loading A-Z filters as and when they are actually needed. Load the data as it's needed, there's no need to populate the list fully from the very beginning...
 
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
Hello @scsjc,
I have 2 questions for you.

  1. Why do you need to load 7089 items into the list at once, there's no need for that?
  2. Why are you not using lazy loading https://www.b4x.com/android/forum/t...ew-lazy-loading-virtualization.87930/#content?
I'm just wondering as nobody ever needs to scrool down 7k+ items. You might be better of loading A-Z filters as and when they are actually needed. Load the data as it's needed, there's no need to populate the list fully from the very beginning...


I have clients who use the app, who have more than 5,000 clients, and that's needed the list, in order to select the client to create invoice.

but it is true, the idea is wrong, visualizing all clients does not make sense, it is much better to write in a textbox and use a SearchView that starts looking from the 2nd character or 3rd character.

Anyway, I had not seen the use of lazy loading, and it seems like a good idea.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
I have clients who use the app, who have more than 5,000 clients, and that's needed the list, in order to select the client to create invoice.
We have as much clients. No one here needs a complete list; no one want it! We do a search using a name, a address, a phonenumber, a customerid and then we do find the customer much more easier than using a list of 5000 Clients which one need to search manually.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Anyway, I had not seen the use of lazy loading, and it seems like a good idea.

Example, I have a particular client who has slightly over 302,000 invoice and well over 557,000 quotes, I've just logged in to check. The mobile sales team uses an Android app that I developed for them, and no I do not load over 302k invoices or over 557k quotes into the xCLV's. I actually load the last 1000 invoices/quotes and then I use a modified version of the Lazy Loading to load the previous 1000 invoices/quotes to populate the xCLV's.

Please note: 1000 lines takes in average time of 8/10th of a second in my apps to populate the xCLV's (each line has multiple labels to fill), this is using 4G mobile data.

There is a 'Full Population' button that warns against and about the extra time it takes to load all invoices/quotes, all my bespoke apps manipulate active search filters to get users the list and information they require almost instantly (easily within 1 second using 4G).

No, there's never ever a need to load thousands of lines into a list, never.

Enjoy...
 
Last edited:
Upvote 0

scsjc

Well-Known Member
Licensed User
Longtime User
We have as much clients. No one here needs a complete list; no one want it! We do a search using a name, a address, a phonenumber, a customerid and then we do find the customer much more easier than using a list of 5000 Clients which one need to search manually.
totally agree, yesterday when I was thinking about this, I did not realize that the simplest thing is as I was already doing.
 
Upvote 0
Top