Commenting out DispBegin() and DispEnd() is not the right thing to do.
WBrowse is the fastest browse. XBrowse is not created to provide a faster alternative, but a feature-rich browse. Still with oBrw:lFastDraw set to .t., speeds are closer to wbrowse though not faster.
It is worth testing xbrowse's performance with a very large table. In this following sample, we create a DBF with One Million Records, 81 fields and recordsize of 1061 bytes and try to browse it.
Code: Select all
#include "fivewin.ch"
REQUEST DBFCDX
function Main()
field FIRST,LAST,STREET,CITY,STATE,ZIP,HIREDATE,MARRIED,AGE,SALARY
field FIRST2,LAST2,STREET2,CITY2,STATE2,ZIP2,HIREDATE2,MARRIED2,AGE2,SALARY2
field FIRST3,LAST3,STREET3,CITY3,STATE3,ZIP3,HIREDATE3,MARRIED3,AGE3,SALARY3
field FIRST4,LAST4,STREET4,CITY4,STATE4,ZIP4,HIREDATE4,MARRIED4,AGE4,SALARY4
field FIRST5,LAST5,STREET5,CITY5,STATE5,ZIP5,HIREDATE5,MARRIED5,AGE5,SALARY5
field FIRST6,LAST6,STREET6,CITY6,STATE6,ZIP6,HIREDATE6,MARRIED6,AGE6,SALARY6
field FIRST7,LAST7,STREET7,CITY7,STATE7,ZIP7,HIREDATE7,MARRIED7,AGE7,SALARY7
field FIRST8,LAST8,STREET8,CITY8,STATE8,ZIP8,HIREDATE8,MARRIED8,AGE8,SALARY8
local aStruct, cCust, cmiln, n, nLen, a, i, c
cCust := "c:\fwh\samples\customer.dbf"
cmiln := "c:\fwh\samples\custmiln.dbf"
if File( cmiln )
USE ( cmiln ) NEW ALIAS "CUST" VIA "DBFCDX"
else
aStruct := FW_DBFSTRUCT( cCust )
ASize( aStruct, Len( aStruct ) - 1 )
nLen := Len( aStruct )
for i := 2 to 8
c := Str( i, 1, 0 )
for n := 2 to nLen
a := AClone( aStruct[ n ] )
a[ 1 ] += c
AAdd( aStruct, a )
next
next
XBROWSER aStruct SHOW SLNUM
DBCREATE( cmiln, aStruct, "DBFCDX", .t., "CUST" )
for n := 1 to 2000
APPEND FROM c:\fwh\samples\customer.dbf ;
FIELDS FIRST,LAST,STREET,CITY,STATE,ZIP,HIREDATE,MARRIED,AGE,SALARY
next
GO TOP
REPLACE ALL FIRST2 WITH FIRST, LAST2 WITH LAST, CITY2 WITH CITY, STATE2 WITH STATE, ;
ZIP2 WITH ZIP, HIREDATE2 WITH HIREDATE, MARRIED2 WITH MARRIED, ;
AGE2 WITH AGE, SALARY2 WITH SALARY
REPLACE ALL FIRST3 WITH FIRST, LAST3 WITH LAST, CITY3 WITH CITY, STATE3 WITH STATE, ;
ZIP3 WITH ZIP, HIREDATE3 WITH HIREDATE, MARRIED3 WITH MARRIED, ;
AGE3 WITH AGE, SALARY3 WITH SALARY
REPLACE ALL FIRST4 WITH FIRST, LAST4 WITH LAST, CITY4 WITH CITY, STATE4 WITH STATE, ;
ZIP4 WITH ZIP, HIREDATE4 WITH HIREDATE, MARRIED4 WITH MARRIED, ;
AGE4 WITH AGE, SALARY4 WITH SALARY
REPLACE ALL FIRST5 WITH FIRST, LAST5 WITH LAST, CITY5 WITH CITY, STATE5 WITH STATE, ;
ZIP5 WITH ZIP, HIREDATE5 WITH HIREDATE, MARRIED5 WITH MARRIED, ;
AGE5 WITH AGE, SALARY5 WITH SALARY
REPLACE ALL FIRST6 WITH FIRST, LAST6 WITH LAST, CITY6 WITH CITY, STATE6 WITH STATE, ;
ZIP6 WITH ZIP, HIREDATE6 WITH HIREDATE, MARRIED6 WITH MARRIED, ;
AGE6 WITH AGE, SALARY6 WITH SALARY
REPLACE ALL FIRST7 WITH FIRST, LAST7 WITH LAST, CITY7 WITH CITY, STATE7 WITH STATE, ;
ZIP7 WITH ZIP, HIREDATE7 WITH HIREDATE, MARRIED7 WITH MARRIED, ;
AGE7 WITH AGE, SALARY7 WITH SALARY
REPLACE ALL FIRST8 WITH FIRST, LAST8 WITH LAST, CITY8 WITH CITY, STATE8 WITH STATE, ;
ZIP8 WITH ZIP, HIREDATE8 WITH HIREDATE, MARRIED8 WITH MARRIED, ;
AGE8 WITH AGE, SALARY8 WITH SALARY
GO TOP
FW_CdxCreate( "ID,FIRST,LAST,STREET,CITY,STATE,ZIP,HIREDATE,MARRIED,AGE,SALARY" )
GO TOP
endif
XBROWSER ALIAS() TITLE "One Million Records: 81 Fields: Record Len: 1061" ;
SETUP ( oBrw:aCols[ 1 ]:cEditPicture := "99,999,999", oBrw:lFastDraw := .t., ;
oBrw:lVThumbTrack := .t., oBrw:lAutosort := .t. )
return nil