Xbase++/Express++ Performance Issues
Posted: Mon Feb 25, 2013 8:40 am
Out of curousity, I was testing the time taken for some routines in our applications for performance. Here are my initial findings:
Function PerfomanceTest()
LOCAL x[3], nCount := 1, nRecs := 100000000
Local oProg := ProgressBar():New()
oProg:nMaxCount := nRecs
x[1] := Seconds()
Do While nCount <= nRecs
nCount++
Enddo
x[1] := Seconds() - x[1]
oProg:ProgressBar(0)
x[2] := Seconds()
Do While oProg:nRecCounter <= nRecs
oProg:ProgressBar(1,oProg:nRecCounter++)
Enddo
x[2] := Seconds() - x[2]
oProg:ProgressBar(2)
x[3] := Seconds()
For I := 1 To nRecs
nCount++
Next
x[3] := Seconds() - x[3]
DC_Arrayview( x )
Return nil
Result: x[1] ---> 0.98 seconds
x[2] ----> 4437.77 seconds (1 hour, 24 minutes)
x[3] ----> 29.73 seconds
Inference: 1. Do while ... enddo is faster than For ... Next contruct
2. Progress Bar Class/Function slows down Database Processes in a very serious magnitude.
I need a Progress bar coded in Assembly Language or Compiler that uses registered based parameter passing like PowerBasic or Defunct TopSpeed C++
Function PerfomanceTest()
LOCAL x[3], nCount := 1, nRecs := 100000000
Local oProg := ProgressBar():New()
oProg:nMaxCount := nRecs
x[1] := Seconds()
Do While nCount <= nRecs
nCount++
Enddo
x[1] := Seconds() - x[1]
oProg:ProgressBar(0)
x[2] := Seconds()
Do While oProg:nRecCounter <= nRecs
oProg:ProgressBar(1,oProg:nRecCounter++)
Enddo
x[2] := Seconds() - x[2]
oProg:ProgressBar(2)
x[3] := Seconds()
For I := 1 To nRecs
nCount++
Next
x[3] := Seconds() - x[3]
DC_Arrayview( x )
Return nil
Result: x[1] ---> 0.98 seconds
x[2] ----> 4437.77 seconds (1 hour, 24 minutes)
x[3] ----> 29.73 seconds
Inference: 1. Do while ... enddo is faster than For ... Next contruct
2. Progress Bar Class/Function slows down Database Processes in a very serious magnitude.
I need a Progress bar coded in Assembly Language or Compiler that uses registered based parameter passing like PowerBasic or Defunct TopSpeed C++