home *** CD-ROM | disk | FTP | other *** search
- Micro Cornucopia issue #43
- dBASE compiler comparison
- Bench mark code:
-
- NOTES:
- LINKING FOR CLIPPER WAS DONE WITH PLINK86 AS IT WOULD NOT WORK WITH TLINK.
- LINKING FOR QUICKSILVER WAS DONE WITH TLINK.
- QUICKSILVER(D) IS dCODE
- QUICKSILVER IS A REGULAR .EXE FILE
- TESTS WERE RUN ON A 386 AT 16 MHz
-
- FILE TEST CONSISTS OF:
- STRING C 100
- NUMBER N 10 2
- LOGIC L 1
- DATE D 8
- MEMO M 10
-
-
-
-
- TEST 1 - LOOP TO SCREEN OF 1000 ITERATIONS
- =============================================================================
- CODE:
- clear
- set talk off
- public start_time,s_hours,s_mins,s_secs,;
- e_hours,e_mins,e_secs,start_secs,end_secs,end_time,nmbr_secs
- *** CONTANTS
- hour_mult=3600
- min_mult=60
- *** GET STARTING TIME
- start_time=time()
- s_hours=val(substr(start_time,1,2))*hour_mult
- s_mins=val(substr(start_time,4,2))*min_mult
- s_secs=val(substr(start_time,7,2))
- start_secs=s_hours+s_mins+s_secs
- @ 5,5 say "starting time is: "+start_time
-
- ******* TIMING LOOP
- xx=1
- do while xx<1000
- @ 10,5 say " this is a test "+str(xx,10)
- xx=xx+1
- enddo
-
- ******* GET ENDING TIME **********
- end_time=time()
- @ 15,5 say "ending time is: "+end_time
- e_hours=val(substr(end_time,1,2))*hour_mult
- e_mins=val(substr(end_time,4,2))*min_mult
- e_secs=val(substr(end_time,7,2))
- end_secs=e_hours+e_mins+e_secs
- nmbr_secs=end_secs-start_secs
- @ 20,5 say "number of seconds: "+str(nmbr_secs,10)
-
- wait
-
-
-
- TEST 2 - APPEND 1000 RECORD
- ==============================================================================
- CODE:
- clear
- set talk off
- set safety off
-
- public start_time,s_hours,s_mins,s_secs,;
- e_hours,e_mins,e_secs,start_secs,end_secs,end_time,nmbr_secs
- *** CONSTANTS
- hour_mult=3600
- min_mult=60
-
- *** GET STARTING TIME
- start_time=time()
- s_hours=val(substr(start_time,1,2))*hour_mult
- s_mins=val(substr(start_time,4,2))*min_mult
- s_secs=val(substr(start_time,7,2))
- start_secs=s_hours+s_mins+s_secs
- @ 5,5 say "starting time is: "+start_time
-
- *******TIMING LOOP
- xx=1
- use test
- zap
- do while xx<1000
- append blank
- @ 10,5 say " this is a record "+str(xx,10)
- xx=xx+1
- enddo
-
- ****** GET ENDING TIME
- end_time=time()
- @ 15,5 say "ending time is: "+end_time
- e_hours=val(substr(end_time,1,2))*hour_mult
- e_mins=val(substr(end_time,4,2))*min_mult
- e_secs=val(substr(end_time,7,2))
- end_secs=e_hours+e_mins+e_secs
- nmbr_secs=end_secs-start_secs
- @ 20,5 say "number of seconds: "+str(nmbr_secs,10)
-
- wait
-
-
-
-
-
- TEST 3 - REPLACE NUMERIC FIELD IN 1000 RECORDS
- =============================================================================
- CODE:
- clear
- set talk off
- set safety off
- public start_time,s_hours,s_mins,s_secs,;
- e_hours,e_mins,e_secs,start_secs,end_secs,end_time,nmbr_secs
-
- ***** CONSTANTS
- hour_mult=3600
- min_mult=60
-
- **** GET STARTING TIME
- start_time=time()
- s_hours=val(substr(start_time,1,2))*hour_mult
- s_mins=val(substr(start_time,4,2))*min_mult
- s_secs=val(substr(start_time,7,2))
- start_secs=s_hours+s_mins+s_secs
- @ 5,5 say "starting time is: "+start_time
-
- **** TIMING LOOP
- xx=1
- use test
- do while xx<1000
- REPLACE NUMBER WITH XX
- @ 10,5 say " this is a record "+str(xx,10)
- SKIP
- xx=xx+1
- enddo
-
- ********* GET ENDING TIME
- end_time=time()
- @ 15,5 say "ending time is: "+end_time
- e_hours=val(substr(end_time,1,2))*hour_mult
- e_mins=val(substr(end_time,4,2))*min_mult
- e_secs=val(substr(end_time,7,2))
- end_secs=e_hours+e_mins+e_secs
- nmbr_secs=end_secs-start_secs
- @ 20,5 say "number of seconds: "+str(nmbr_secs,10)
- wait
-
-
-
-
-
- TEST 4 - INDEX 1000 RECORD FILE ON NUMERIC FIELD
- =============================================================================
- CODE:
- clear
- set safety off
- set talk off
- public start_time,s_hours,s_mins,s_secs,;
- e_hours,e_mins,e_secs,start_secs,end_secs,end_time,nmbr_secs
- *** CONSTANTS
- hour_mult=3600
- min_mult=60
-
- *** GET START TIME
- start_time=time()
- s_hours=val(substr(start_time,1,2))*hour_mult
- s_mins=val(substr(start_time,4,2))*min_mult
- s_secs=val(substr(start_time,7,2))
- start_secs=s_hours+s_mins+s_secs
- @ 5,5 say "starting time is: "+start_time
-
- *** TIMING LOOP
- use test
- INDEX ON NUMBER TO TEST
-
- *** GET END TIME
- end_time=time()
- @ 15,5 say "ending time is: "+end_time
- e_hours=val(substr(end_time,1,2))*hour_mult
- e_mins=val(substr(end_time,4,2))*min_mult
- e_secs=val(substr(end_time,7,2))
- end_secs=e_hours+e_mins+e_secs
- nmbr_secs=end_secs-start_secs
- @ 20,5 say "number of seconds: "+str(nmbr_secs,10)
- wait
-
-