mrossen Active Member Licensed User Longtime User Mar 29, 2015 #1 HI, I use at for next to loop a list. On my android device (HTC M8) it runs with ok speed. The similer code on my iPhone5 runs real slow. Is there a faster/smarter way to do this. Code: Copy For i = 0 To brand_cars.Size - 1 mCars = brand_cars.Get(i) tmpBrand = mCars.Get("brand") Log(i) fChar = tmpBrand.CharAt(0) If fChar = Cell.Text.ToString Then TableViewCars.SetSelection(SectionIndex, i) Log(tmpBrand) Return End If Next I use the log(i) see the speed in the log. If I rem the this section out it runs much faster. Code: Copy If fChar = Cell.Text.ToString Then TableViewCars.SetSelection(SectionIndex, i) Log(tmpBrand) Return End If What I want to do is find ex. the first cell where the cell text starts with ex. a "T" Mogens
HI, I use at for next to loop a list. On my android device (HTC M8) it runs with ok speed. The similer code on my iPhone5 runs real slow. Is there a faster/smarter way to do this. Code: Copy For i = 0 To brand_cars.Size - 1 mCars = brand_cars.Get(i) tmpBrand = mCars.Get("brand") Log(i) fChar = tmpBrand.CharAt(0) If fChar = Cell.Text.ToString Then TableViewCars.SetSelection(SectionIndex, i) Log(tmpBrand) Return End If Next I use the log(i) see the speed in the log. If I rem the this section out it runs much faster. Code: Copy If fChar = Cell.Text.ToString Then TableViewCars.SetSelection(SectionIndex, i) Log(tmpBrand) Return End If What I want to do is find ex. the first cell where the cell text starts with ex. a "T" Mogens
Erel B4X founder Staff member Licensed User Longtime User Mar 29, 2015 #2 It is most probably the debugger that slows it down. Try this: - Tools - Clean Project - Edit - Remove all breakpoints Now run your app. If it is still slow, test it in release mode. You can use this tool to read the logs: iReleaseLogger - Read the logs in release mode Upvote 0
It is most probably the debugger that slows it down. Try this: - Tools - Clean Project - Edit - Remove all breakpoints Now run your app. If it is still slow, test it in release mode. You can use this tool to read the logs: iReleaseLogger - Read the logs in release mode
mrossen Active Member Licensed User Longtime User Mar 29, 2015 #3 Your are a star Clean project did the job. Mogens Upvote 0