home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume10 / comobj.lisp / part02 / co-prof.l < prev    next >
Encoding:
Text File  |  1987-07-30  |  5.3 KB  |  246 lines

  1.  
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;
  4. ; File:         co-prof.l
  5. ; SCCS:         %A% %G% %U%
  6. ; Description:  Profiling For COOL
  7. ; Author:       James Kempf, HP/DCC
  8. ; Created:      10-Feb-87
  9. ; Modified:     25-Feb-87 10:51:31 (James Kempf)
  10. ; Language:     Lisp
  11. ; Package:      TEST
  12. ;
  13. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  14.  
  15. (in-package 'test)
  16.  
  17. (require "co")
  18.  
  19. (use-package 'co)
  20.  
  21. (require "co-profmacs")
  22.  
  23. ;;Collection Variable for Test Functions
  24.  
  25. (defvar *function-symbols* NIL)
  26.  
  27. ;;Default names for output file and output messages.
  28. ;;  Can be overridden before this file is loaded.
  29.  
  30. (defvar *output-file-name* "runprof.out")
  31. (defvar *definition-message* "COOL Definition Results")
  32. (defvar *redefinition-message* "COOL Redefinition Results")
  33.  
  34. ;;Run everything compiled so that best
  35. ;;  times are obtained.
  36.  
  37. ;;Measurement of Type Definition
  38.  
  39. ;;Warmup
  40.  
  41. (do-type-definition NIL 0 0)
  42. (compile (first *function-symbols*))
  43. (funcall (first *function-symbols*))
  44.  
  45. ;;No instance variables and no parents
  46.  
  47. (do-type-definition T 0 0)
  48. (compile (first *function-symbols*))
  49. (funcall (first *function-symbols*))
  50.  
  51. ;;One instance variable and no parents
  52.  
  53. (do-type-definition T 1 0)
  54. (compile (first *function-symbols*))
  55. (funcall (first *function-symbols*))
  56.  
  57. ;;Two instance variables and no parents
  58.  
  59. (do-type-definition T 2 0)
  60. (compile (first *function-symbols*))
  61. (funcall (first *function-symbols*))
  62.  
  63. ;;Three instance variables and no parents
  64.  
  65. (do-type-definition T 3 0)
  66. (compile (first *function-symbols*))
  67. (funcall (first *function-symbols*))
  68.  
  69. ;;No variables and one parent
  70.  
  71. (do-type-definition T 0 1)
  72. (compile (first *function-symbols*))
  73. (funcall (first *function-symbols*))
  74.  
  75. ;;No variables and two parents
  76.  
  77. (do-type-definition T 0 2)
  78. (compile (first *function-symbols*))
  79. (funcall (first *function-symbols*))
  80.  
  81. ;;No variables and three parents
  82.  
  83. (do-type-definition T 0 3)
  84. (compile (first *function-symbols*))
  85. (funcall (first *function-symbols*))
  86.  
  87. ;;Measure Instance Creation
  88.  
  89. ;;Warmup
  90.  
  91. (do-instance-creation NIL 0 0)
  92. (compile (first *function-symbols*))
  93. (funcall (first *function-symbols*))
  94.  
  95. ;;No instance variables and no parents
  96.  
  97. (do-instance-creation T 0 0)
  98. (compile (first *function-symbols*))
  99. (funcall (first *function-symbols*))
  100.  
  101. ;;One instance variable and no parents
  102.  
  103. (do-instance-creation T 1 0)
  104. (funcall (first *function-symbols*))
  105.  
  106. ;;Two instance variables and no parents
  107.  
  108. (do-instance-creation T 2 0)
  109. (compile (first *function-symbols*))
  110. (funcall (first *function-symbols*))
  111.  
  112. ;;Three instance variables and no parents
  113.  
  114. (do-instance-creation T 3 0)
  115. (compile (first *function-symbols*))
  116. (funcall (first *function-symbols*))
  117.  
  118. ;;No variables and one parent
  119.  
  120. (do-instance-creation T 0 1)
  121. (compile (first *function-symbols*))
  122. (funcall (first *function-symbols*))
  123.  
  124. ;;No variables and two parents
  125.  
  126. (do-instance-creation T 0 2)
  127. (compile (first *function-symbols*))
  128. (funcall (first *function-symbols*))
  129.  
  130. ;;No variables and three parents
  131.  
  132. (do-instance-creation T 0 3)
  133. (compile (first *function-symbols*))
  134. (funcall (first *function-symbols*))
  135.  
  136. ;;Measurement of Method Definition
  137.  
  138. (do-method-definition NIL 0 temp1)
  139. (compile (first *function-symbols*))
  140. (funcall (first *function-symbols*))
  141.  
  142. ;;So that new symbols will be generated
  143.  
  144. (setf *list-of-method-symbols* NIL)
  145.  
  146. ;;No predefined method
  147.  
  148. (do-method-definition T 0 temp1)
  149. (compile (first *function-symbols*))
  150. (funcall (first *function-symbols*))
  151.  
  152. ;;Measure method invocation
  153.  
  154. (do-messaging T 1 temp1)
  155. (compile (first *function-symbols*))
  156. (funcall (first *function-symbols*))
  157.  
  158. ;;One predefined method
  159.  
  160. (do-method-definition T 1 temp2)
  161. (compile (first *function-symbols*))
  162. (funcall (first *function-symbols*))
  163.  
  164. ;;Measure method invocation
  165.  
  166. (do-messaging T 2 temp1 temp2)
  167. (compile (first *function-symbols*))
  168. (funcall (first *function-symbols*))
  169.  
  170. ;;Two predefined methods
  171.  
  172. (do-method-definition T 2 temp3)
  173. (compile (first *function-symbols*))
  174. (funcall (first *function-symbols*))
  175.  
  176. ;;Measure method invocation
  177.  
  178. (do-messaging T 3 temp1 temp2 temp3)
  179. (compile (first *function-symbols*))
  180. (funcall (first *function-symbols*))
  181.  
  182. ;;Three predefined methods
  183.  
  184. (do-method-definition T 3 temp4)
  185. (compile (first *function-symbols*))
  186. (funcall (first *function-symbols*))
  187.  
  188. ;;Measure method invocation
  189.  
  190. (do-messaging T 4 temp1 temp2 temp3 temp4)
  191. (compile (first *function-symbols*))
  192. (funcall (first *function-symbols*))
  193.  
  194. ;;Method Invocation and Inheritence
  195.  
  196. (do-inherited-messaging NIL 0 g0f)
  197. (compile (first *function-symbols*))
  198. (funcall (first *function-symbols*))
  199.  
  200. ;;No inheritence
  201.  
  202. (do-inherited-messaging T 0 g0f)
  203. (compile (first *function-symbols*))
  204. (funcall (first *function-symbols*))
  205.  
  206.  
  207. ;;One level
  208.  
  209. (do-inherited-messaging T 1 g1f)
  210. (compile (first *function-symbols*))
  211. (funcall (first *function-symbols*))
  212.  
  213.  
  214. ;;Two levels
  215.  
  216. (do-inherited-messaging T 2 g2f)
  217. (compile (first *function-symbols*))
  218. (funcall (first *function-symbols*))
  219.  
  220.  
  221. ;;Three levels
  222.  
  223. (do-inherited-messaging T 3 g3f)
  224. (compile (first *function-symbols*))
  225. (funcall (first *function-symbols*))
  226.  
  227.  
  228. ;;Dump out the results
  229.  
  230. (print-results *output-file-name* *definition-message*)
  231.  
  232. ;;Run Everything Again
  233.  
  234. (dolist (l (reverse *function-symbols*))
  235.   (funcall l)
  236. )
  237.  
  238. ;;And dump results
  239.  
  240. (print-results *output-file-name* *redefinition-message*)
  241.  
  242. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  243.  
  244. (provide "co-prof")
  245.  
  246.