Android Question PreoptimizedCLV versus Lazy loading Bench Mark

Mahares

Expert
Licensed User
Longtime User
I tested a SQLite database on an average tablet with OS 8 having one table with about 7700 records and 8 columns using the standard lazy loading we have been accustomed to versus the new PreoptimizedCLV just recently developed by Erel. Needless to say, the PreoptimizedCLV out performed the other. It took the standard Lazy Loading 3.3 sec to load the entire number of records, whereas the PreoptimizedCLV (extended LL) did it in 0.88 sec. Although 3.3 sec is not an eternity, this is just to illustrate the superiority of PCLV.
The scrolling over the items is significantly smoother using PCLV. Jumping from the 1st to the last record was extremely fast for both and was the same.
I would like to know if there are any other bench mark tests I should be conducting for added comparison between the two.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
The PCLV part of creating 7700 items doesn't take 880ms. On my device it takes 17ms. You can test it with:
B4X:
Sub Fill
    Dim n As Long = DateTime.Now
    For t = 1 To 7700
        PCLV.AddItem(100dip, xui.Color_White, t)
    Next
    PCLV.Commit
    Log(DateTime.Now - n)   
End Sub
Don't forget to do it in release mode.
Fetching the data from the database probably takes most of the time.

With that said we should be careful not to preoptimize a few milliseconds that no one will ever see.
 
Upvote 0

Mahares

Expert
Licensed User
Longtime User
With that said we should be careful not to preoptimize a few milliseconds that no one will ever see.
1. The purpose of my test was to demonstrate that PCLV is faster than the normal LL
2. The 880 ms realized in my test was on a SQLite database table that has 8 columns and all data was formatted and displayed on the CLV. Your test was on a single column displaying 7700 rows ( 17 ms).
3. I tested my database example in release mode and the test yielded the same 900 ms as debug.
4. I got from your response that you are not fully convinced that PCLV is superior to LL CLV
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I got from your response that you are not fully convinced that PCLV is superior to LL CLV
PCLV extends xCLV. It is not superior and not not superior.

The numbers from your benchmark can be confusing and can lead to the conclusion that it takes 0.8 seconds to build a list with 8000 items. This is not the case. It takes 20 ms to create 8000 items with PCLV. Naturally there may be other bottlenecks such as in your case.
 
Upvote 0
Top