Android Question Strange speed issue

Drago Bratko

Member
Licensed User
Longtime User
I have notice this just now. I use B4A v8.00.
This happeneds for sure in Debug mode. In Release mode it works fine.

Example code which runns fast:
B4X:
    For Each od As Odjel In Odjeli
        If od.brojradg = ItemID Then
            'Log(od.sradgrupa)
            lbl.Text = PublicThings.RemoveSpaces(od.sradgrupa)

            'Log(od.bojat)
            hBoja = PublicThings.LongToHexStr(od.bojat)
            nBoja = Colors.RGB(PublicThings.HexToRColor(hBoja),PublicThings.HexToGColor(hBoja),PublicThings.HexToBColor(hBoja))
            lbl.TextColor = nBoja
            
            'Log(od.boja)
            hBoja = PublicThings.LongToHexStr(od.boja)
            nBoja = Colors.RGB(PublicThings.HexToRColor(hBoja),PublicThings.HexToGColor(hBoja),PublicThings.HexToBColor(hBoja))
            lbl.Color = nBoja

            Exit
        End If
    Next

But if I remove commented "Log" parts (which are anyhow commented), code execution is rapidly slower.
B4X:
    For Each od As Odjel In Odjeli
        If od.brojradg = ItemID Then
            lbl.Text = PublicThings.RemoveSpaces(od.sradgrupa)

            hBoja = PublicThings.LongToHexStr(od.bojat)
            nBoja = Colors.RGB(PublicThings.HexToRColor(hBoja),PublicThings.HexToGColor(hBoja),PublicThings.HexToBColor(hBoja))
            lbl.TextColor = nBoja
            
            hBoja = PublicThings.LongToHexStr(od.boja)
            nBoja = Colors.RGB(PublicThings.HexToRColor(hBoja),PublicThings.HexToGColor(hBoja),PublicThings.HexToBColor(hBoja))
            lbl.Color = nBoja

            Exit
        End If
    Next

Maybe it's important (maybe not) ... it's inside "Node_ContentFiller" Sub of UltimateListView.

Any ideas why would that happened (slowdown) ?
 

Drago Bratko

Member
Licensed User
Longtime User
Hi Erel !

Great, that solve the issue. Thank you.
BTW, what is 'good' time to do cleanup ... from time to time ? Or just when issues happened ? Or ...
 
Upvote 0
Top