I have a CLV that reads almost 280 records from a SQLDB. It then creates each panel for each record on the CLV with the .add(panel) method.
One wierd thing that is happening is that code execution takes a whole lot less in DEBUG MODE than what it takes on RELEASE MODE. I have done 2 tests for each mode. RELEASE averages almost 15 seconds for the panel insert. DEBUG takes arround 3.5secs. Cannot seem to find why this happends. RELEASE should be faster than DEBUG or not?
Test Results:
-DEBUG MODE-TEST #1
List Size:276
FINISH SQL MAP BUILD:3
FINISH INSERT SQL Statements:32
FINISH CREATING PANELS:3284
-DEBUG MODE-TEST #2
List Size:276
FINISH SQL MAP BUILD:3
FINISH INSERT SQL Statements:28
FINISH CREATING PANELS:3299
-RELEASE MODE-TEST #1
List Size:276
FINISH SQL MAP BUILD:3
FINISH INSERT SQL Statements:180
FINISH CREATING PANELS:14986
-RELEASE MODE-TEST #2
List Size:276
FINISH SQL MAP BUILD:4
FINISH INSERT SQL Statements:34
FINISH CREATING PANELS:14834
One wierd thing that is happening is that code execution takes a whole lot less in DEBUG MODE than what it takes on RELEASE MODE. I have done 2 tests for each mode. RELEASE averages almost 15 seconds for the panel insert. DEBUG takes arround 3.5secs. Cannot seem to find why this happends. RELEASE should be faster than DEBUG or not?
B4X:
Dim startTime As Long=DateTime.now
For i=0 To inmuebles.Size-1
Dim InmuebleMap As Map=(inmuebles.Get(i))
InmuebleMap.Put("typeInmuebleGlobal", map2.Get("typeInmueble"))
typeInmuebleGlobal= map2.Get("typeInmueble")
Dim insertMap As Map
insertMap.Initialize
insertMap.Put("hashInmueble", InmuebleMap.Get("hashInmueble"))
insertMap.Put("typeInmueble", InmuebleMap.Get("typeInmueble"))
insertMap.Put("inmueble", InmuebleMap.Get("inmueble"))
listOfInmuebles.Add(insertMap)
Next
Log("FINISH SQL MAP BUILD:" & (DateTime.Now-startTime))
If listInmuebles.AsView.Visible=True Then
DBUtils.InsertMaps(x.SQLDB, "inmuebles", listOfInmuebles)
Log("FINISH INSERT SQL Statements:" & (DateTime.Now-startTime))
Dim c1 As Cursor
c1=x.SQLDB.ExecQuery("select * from inmuebles")
Dim maxRecords As Int=34
If c1.RowCount<maxRecords Then maxRecords=c1.RowCount
For i=0 To c1.RowCount-1 'maxRecords
c1.Position=i
Dim InmuebleMap As Map
InmuebleMap.Initialize
InmuebleMap=x.Cursor2Map(c1)
InmuebleMap.Put("typeInmuebleGlobal", typeInmuebleGlobal)
listInmuebles.Add(createInmueble(InmuebleMap), 60dip, InmuebleMap)
'Sleep(0)
Next
listInmuebles.JumpToItem(0)
End If
Log("FINISH CREATING PANELS:" & (DateTime.Now-startTime))
Test Results:
-DEBUG MODE-TEST #1
List Size:276
FINISH SQL MAP BUILD:3
FINISH INSERT SQL Statements:32
FINISH CREATING PANELS:3284
-DEBUG MODE-TEST #2
List Size:276
FINISH SQL MAP BUILD:3
FINISH INSERT SQL Statements:28
FINISH CREATING PANELS:3299
-RELEASE MODE-TEST #1
List Size:276
FINISH SQL MAP BUILD:3
FINISH INSERT SQL Statements:180
FINISH CREATING PANELS:14986
-RELEASE MODE-TEST #2
List Size:276
FINISH SQL MAP BUILD:4
FINISH INSERT SQL Statements:34
FINISH CREATING PANELS:14834