home *** CD-ROM | disk | FTP | other *** search
/ Power Programming / powerprogramming1994.iso / progtool / microcrn / issue_43.arc / COMPILE.PRG < prev    next >
Text File  |  1988-07-28  |  4KB  |  190 lines

  1. Micro Cornucopia issue #43
  2. dBASE compiler comparison
  3. Bench mark code:
  4.  
  5. NOTES:
  6. LINKING FOR CLIPPER WAS DONE WITH PLINK86 AS IT WOULD NOT WORK WITH TLINK.
  7. LINKING FOR QUICKSILVER WAS DONE WITH TLINK.
  8. QUICKSILVER(D) IS dCODE
  9. QUICKSILVER IS A REGULAR .EXE FILE
  10. TESTS WERE RUN ON A 386 AT 16 MHz
  11.  
  12. FILE TEST CONSISTS OF:
  13. STRING C 100
  14. NUMBER N 10 2
  15. LOGIC  L 1
  16. DATE   D 8
  17. MEMO   M 10
  18.  
  19.  
  20.  
  21.  
  22. TEST 1 - LOOP TO SCREEN OF 1000 ITERATIONS
  23. =============================================================================
  24. CODE:
  25. clear
  26. set talk off
  27. public start_time,s_hours,s_mins,s_secs,;
  28. e_hours,e_mins,e_secs,start_secs,end_secs,end_time,nmbr_secs
  29. *** CONTANTS
  30. hour_mult=3600
  31. min_mult=60
  32. *** GET STARTING TIME
  33. start_time=time()
  34. s_hours=val(substr(start_time,1,2))*hour_mult
  35. s_mins=val(substr(start_time,4,2))*min_mult
  36. s_secs=val(substr(start_time,7,2))
  37. start_secs=s_hours+s_mins+s_secs
  38. @ 5,5 say "starting time is: "+start_time
  39.  
  40. ******* TIMING LOOP
  41. xx=1
  42. do while xx<1000
  43. @ 10,5 say " this is a test "+str(xx,10)
  44. xx=xx+1
  45. enddo
  46.  
  47. ******* GET ENDING TIME **********
  48. end_time=time()
  49. @ 15,5 say "ending time is: "+end_time
  50. e_hours=val(substr(end_time,1,2))*hour_mult
  51. e_mins=val(substr(end_time,4,2))*min_mult
  52. e_secs=val(substr(end_time,7,2))
  53. end_secs=e_hours+e_mins+e_secs
  54. nmbr_secs=end_secs-start_secs
  55. @ 20,5 say "number of seconds: "+str(nmbr_secs,10)
  56.  
  57. wait
  58.  
  59.  
  60.  
  61. TEST 2 - APPEND 1000 RECORD
  62. ==============================================================================
  63. CODE:
  64. clear
  65. set talk off
  66. set safety off
  67.  
  68. public start_time,s_hours,s_mins,s_secs,;
  69. e_hours,e_mins,e_secs,start_secs,end_secs,end_time,nmbr_secs
  70. *** CONSTANTS
  71. hour_mult=3600
  72. min_mult=60
  73.  
  74. *** GET STARTING TIME
  75. start_time=time()
  76. s_hours=val(substr(start_time,1,2))*hour_mult
  77. s_mins=val(substr(start_time,4,2))*min_mult
  78. s_secs=val(substr(start_time,7,2))
  79. start_secs=s_hours+s_mins+s_secs
  80. @ 5,5 say "starting time is: "+start_time
  81.  
  82. *******TIMING LOOP
  83. xx=1
  84. use test
  85. zap
  86. do while xx<1000
  87. append blank
  88. @ 10,5 say " this is a record "+str(xx,10)
  89. xx=xx+1
  90. enddo
  91.  
  92. ****** GET ENDING TIME
  93. end_time=time()
  94. @ 15,5 say "ending time is: "+end_time
  95. e_hours=val(substr(end_time,1,2))*hour_mult
  96. e_mins=val(substr(end_time,4,2))*min_mult
  97. e_secs=val(substr(end_time,7,2))
  98. end_secs=e_hours+e_mins+e_secs
  99. nmbr_secs=end_secs-start_secs
  100. @ 20,5 say "number of seconds: "+str(nmbr_secs,10)
  101.  
  102. wait
  103.  
  104.  
  105.  
  106.  
  107.  
  108. TEST 3 - REPLACE NUMERIC FIELD IN 1000 RECORDS
  109. =============================================================================
  110. CODE:
  111. clear
  112. set talk off
  113. set safety off
  114. public start_time,s_hours,s_mins,s_secs,;
  115. e_hours,e_mins,e_secs,start_secs,end_secs,end_time,nmbr_secs
  116.  
  117. ***** CONSTANTS
  118. hour_mult=3600
  119. min_mult=60
  120.  
  121. **** GET STARTING TIME
  122. start_time=time()
  123. s_hours=val(substr(start_time,1,2))*hour_mult
  124. s_mins=val(substr(start_time,4,2))*min_mult
  125. s_secs=val(substr(start_time,7,2))
  126. start_secs=s_hours+s_mins+s_secs
  127. @ 5,5 say "starting time is: "+start_time
  128.  
  129. **** TIMING LOOP
  130. xx=1
  131. use test
  132. do while xx<1000
  133. REPLACE NUMBER WITH XX
  134. @ 10,5 say " this is a record "+str(xx,10)
  135. SKIP
  136. xx=xx+1
  137. enddo
  138.  
  139. ********* GET ENDING TIME
  140. end_time=time()
  141. @ 15,5 say "ending time is: "+end_time
  142. e_hours=val(substr(end_time,1,2))*hour_mult
  143. e_mins=val(substr(end_time,4,2))*min_mult
  144. e_secs=val(substr(end_time,7,2))
  145. end_secs=e_hours+e_mins+e_secs
  146. nmbr_secs=end_secs-start_secs
  147. @ 20,5 say "number of seconds: "+str(nmbr_secs,10)
  148. wait
  149.  
  150.  
  151.  
  152.  
  153.  
  154. TEST 4 - INDEX 1000 RECORD FILE ON NUMERIC FIELD
  155. =============================================================================
  156. CODE:
  157. clear
  158. set safety off
  159. set talk off
  160. public start_time,s_hours,s_mins,s_secs,;
  161. e_hours,e_mins,e_secs,start_secs,end_secs,end_time,nmbr_secs
  162. *** CONSTANTS
  163. hour_mult=3600
  164. min_mult=60
  165.  
  166. *** GET START TIME
  167. start_time=time()
  168. s_hours=val(substr(start_time,1,2))*hour_mult
  169. s_mins=val(substr(start_time,4,2))*min_mult
  170. s_secs=val(substr(start_time,7,2))
  171. start_secs=s_hours+s_mins+s_secs
  172. @ 5,5 say "starting time is: "+start_time
  173.  
  174. *** TIMING LOOP
  175. use test
  176. INDEX ON NUMBER TO TEST
  177.  
  178. *** GET END TIME
  179. end_time=time()
  180. @ 15,5 say "ending time is: "+end_time
  181. e_hours=val(substr(end_time,1,2))*hour_mult
  182. e_mins=val(substr(end_time,4,2))*min_mult
  183. e_secs=val(substr(end_time,7,2))
  184. end_secs=e_hours+e_mins+e_secs
  185. nmbr_secs=end_secs-start_secs
  186. @ 20,5 say "number of seconds: "+str(nmbr_secs,10)
  187. wait
  188.  
  189.  
  190.