home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume10 / comobj.lisp / part05 / profmacs.l < prev   
Encoding:
Text File  |  1987-07-30  |  19.8 KB  |  873 lines

  1.  
  2. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  3. ;
  4. ; File:         profmacs.l
  5. ; SCCS:         %A% %G% %U%
  6. ; Description:  Macros For Profiling
  7. ; Author:       James Kempf, HP/DCC
  8. ; Created:      7-Feb-87
  9. ; Modified:     25-Feb-87 09:06:08 (James Kempf)
  10. ; Language:     Lisp
  11. ; Package:      TEST
  12. ;
  13. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  14.  
  15. (in-package 'test)
  16. (use-package 'lisp)
  17.  
  18. ;;Need COOL
  19.  
  20. (require "co")
  21. (use-package 'co)
  22.  
  23.  
  24. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  25. ;     System Dependent Customizations
  26. ;
  27. ;  Some systems will have special, hardware or software dependent profiling
  28. ;  packages. If your system has one, put it in here. Otherwise, the default
  29. ;  timing functions from CLtL will be used. In addition, the system dependent
  30. ;  function for garbage collection should be inserted, if your system 
  31. ;  requires garbage collection. Otherwise, no garbage collection will be done.
  32. ;
  33. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  34.  
  35. ;;warn-garbage-collect-Warn that no garbage collection function is in use.
  36.  
  37. (defun warn-garbage-collect ()
  38.   (warn 
  39.     "~&********  Profiling Measurments Could Be Interrupted By Garbage Collection *******"
  40.   )
  41. ) ;warn-garbage-collect
  42.  
  43. ;;*clock-increment-in-milliseconds*-Increment of the clock
  44.  
  45. (defvar *clock-increment-in-milliseconds* 0)
  46.  
  47. ;;Use the 10 microsecond clock
  48.  
  49. #+HP 
  50. (eval-when (load eval)
  51.   (require "measure")
  52.   (setf (symbol-function 'get-time) (symbol-function measure:time10usec))
  53.   (setf *clock-increment-in-milliseconds* 0.01)
  54.   (setf (symbol-function 'do-garbage-collect) (symbol-function 'system:gc))
  55.  
  56. )
  57.  
  58. ;;Default is to just use the functions from Steele
  59.  
  60. #-HP
  61. (eval-when (load eval)
  62.   (setf (symbol-function 'get-time) (symbol-function 'get-internal-real-time))
  63.   (setf *clock-increment-in-milliseconds* 
  64.     (* (float (/ 1.0 internal-time-units-per-second)) 1000.0)
  65.   )
  66.   (setf (symbol-function 'do-garbage-collect) (symbol-function 'warn-garbage-collect))
  67.  
  68. )
  69.  
  70. ;;Switch for Class Definition Syntax
  71.  
  72. (defvar *define-type-switch* T)
  73.  
  74. ;;Vector containing names of types with zero, one, two, and
  75. ;;  three instance variables.
  76.  
  77. (defvar *iv-defined-types* (make-array '(4 4) :initial-element NIL))
  78.  
  79. ;;Lists of results
  80.  
  81. ;;For type definition (iterations ivs parents time)
  82.  
  83. (defvar *define-type-results* NIL)
  84.  
  85. ;;For instance creation (interations ivs parents time)
  86.  
  87. (defvar *creation-results* NIL)
  88.  
  89. ;;For method definition (iterations preexisting time)
  90.  
  91. (defvar *define-method-results* NIL)
  92.  
  93. ;;For messaging (iterations functions time)
  94.  
  95. (defvar *messaging-results* NIL)
  96.  
  97. ;;For inherited messaging (iterations parents time)
  98.  
  99. (defvar *inherited-messaging-results* NIL)
  100.  
  101. ;;These variables and macros are used for inserting the result of
  102. ;;  macroexpantion times into the calculations
  103.  
  104. (defvar *macro-start-clock* 0)
  105. (defvar *macro-end-clock* 0)
  106. (defvar *macro-total-time* 0)
  107.  
  108. (defmacro macro-start-clock ()
  109.  
  110.   (setf *macro-start-clock* (get-time))
  111.   NIL
  112. )
  113.  
  114. (defmacro macro-end-clock ()
  115.  
  116.   (setf *macro-end-clock* (get-time))
  117.   (setf *macro-total-time* (- *macro-end-clock* *macro-start-clock*))
  118.   (setf *macro-end-clock* 0)
  119.   (setf *macro-start-clock* 0)
  120.  
  121.   NIL
  122. )
  123.  
  124. (defmacro macro-insert-sum ()
  125.  
  126.   (let
  127.     (
  128.      (returned-sum *macro-total-time*)
  129.     )
  130.  
  131.     (setf *macro-total-time* 0)
  132.     returned-sum
  133.  )
  134.  
  135. )
  136.  
  137. ;;do-type-definition-Profile Type or Class Definition
  138.  
  139. (defmacro do-type-definition (record variables parents)
  140.  
  141.   (let
  142.     (
  143.       (iv-names NIL)
  144.       (code NIL)
  145.       (tname NIL)
  146.       (pnames NIL)
  147.     )
  148.  
  149.     ;;Construct a new function symbol for this test
  150.  
  151.     (push (gensym) *function-symbols*)
  152.  
  153.     ;;Generate a list of instance variable names
  154.  
  155.     (dotimes (i variables )
  156.       (setf iv-names
  157.         (list*
  158.           (if *define-type-switch*
  159.             `(:var ,(gentemp)) 
  160.             (gentemp)
  161.           )
  162.           iv-names
  163.         ) 
  164.       )
  165.     )
  166.  
  167.     ;;Generate list of parent names
  168.  
  169.     (dotimes (i parents)
  170.       (setf pnames
  171.         (list* 
  172.           (if *define-type-switch*
  173.             `(:inherit-from ,(nth i (aref *iv-defined-types* 0 0))) 
  174.              (nth i (aref *iv-defined-types* 0 0))
  175.           )
  176.           pnames
  177.         )
  178.       )
  179.     )
  180.  
  181.     ;;Generate code for type definition    
  182.  
  183.     (dotimes (i 20)
  184.     
  185.       ;;Generate the name for this type and
  186.       ;;  push onto the appropriate list
  187.  
  188.       (setf tname (gentemp))
  189.  
  190.       (setf (aref *iv-defined-types* parents variables)
  191.             (push tname (aref *iv-defined-types* parents variables))
  192.       )
  193.  
  194.       ;;Generate the type code
  195.  
  196.       (push
  197.         (if *define-type-switch*
  198.           `(define-type ,tname
  199.              ,@iv-names
  200.              ,@pnames
  201.            )
  202.            `(ndefstruct 
  203.              (,tname
  204.                (:class class)
  205.            ,pnames
  206.              )
  207.              ,@iv-names
  208.            )
  209.         ) ;if
  210.  
  211.         code
  212.  
  213.       ) ;push
  214.  
  215.     )
  216.  
  217.     ;;Return code, inserting prolog and cache heating
  218.  
  219.   `(defun ,(first *function-symbols*) ()
  220.     (let
  221.        (
  222.          (after 0)
  223.          (before 0)
  224.          (sum 0)
  225.        )
  226.  
  227.        (tagbody 
  228.        again
  229.  
  230.          (do-garbage-collect)
  231.  
  232.          ,(if *define-type-switch*
  233.            `(define-type ,(gentemp)
  234.              ,@iv-names
  235.              ,@pnames
  236.             )
  237.             `(ndefstruct 
  238.               (,(gentemp)
  239.                (:class class)
  240.            ,pnames
  241.              )
  242.              ,@iv-names
  243.            )
  244.          ) ;if
  245.  
  246.          (setf before (get-time))
  247.          (macro-start-clock)
  248.          ,@code
  249.          (macro-end-clock)
  250.          (setf after (get-time))
  251.  
  252.          (setf sum (macro-insert-sum))
  253.  
  254.  
  255.          (if (< (the integer after) (the integer before))
  256.            (go again)
  257.          )
  258.        )
  259.  
  260.        (if ,record
  261.          (push (list 20 ,variables ,parents (- after before) sum) *define-type-results*)
  262.        )
  263.  
  264.       )
  265.  
  266.     )
  267.  
  268.    ) ;let
  269.  
  270. ) ;do-type-definition
  271.  
  272. (setf (symbol-function 'do-type-definition-macro) (macro-function 'do-type-definition))
  273. (compile 'do-type-definition-macro)
  274. (setf (macro-function 'do-type-definition) (symbol-function 'do-type-definition-macro))
  275.  
  276. ;;do-instance-creation-Create instances of types as above
  277.  
  278. (defmacro do-instance-creation (record ivs parents)
  279.  
  280.   (let
  281.     (
  282.       (code NIL)
  283.     )
  284.  
  285.     ;;Generate a new function symbol
  286.  
  287.     (push (gensym) *function-symbols*)
  288.  
  289.     ;;Generate code to create
  290.  
  291.     (dotimes (i 20)
  292.  
  293.       (push
  294.         `(make-instance ',(nth i (aref *iv-defined-types* parents ivs)))
  295.         code
  296.       )
  297.  
  298.     ) ;dotimes
  299.  
  300.     ;;Return code, inserting prolog and cache heating
  301.  
  302.   `(defun ,(first *function-symbols*) ()
  303.     (let
  304.        (
  305.          (after 0)
  306.          (before 0)
  307.        )
  308.  
  309.        (tagbody
  310.        again
  311.  
  312.          (do-garbage-collect)
  313.  
  314.          (make-instance ',(nth 1 (aref *iv-defined-types* parents ivs)))
  315.  
  316.           (setf before (get-time))
  317.           ,@code
  318.           (setf after (get-time))
  319.  
  320.       (if (< (the integer after) (the integer before))
  321.             (go again)
  322.           )
  323.         )
  324.       
  325.         (if ,record
  326.           (push (list 20 ,ivs ,parents (- after before)) *creation-results*)
  327.         )
  328.  
  329.       )
  330.     )
  331.  
  332.   ) ;let
  333.  
  334. ) ;do-instance-creation
  335.  
  336. (setf (symbol-function 'do-instance-creation-macro) (macro-function 'do-instance-creation))
  337. (compile 'do-instance-creation-macro)
  338. (setf (macro-function 'do-instance-creation) (symbol-function 'do-instance-creation-macro))
  339.  
  340. ;;switch-define-types-Define types depending on switch
  341.  
  342. (defmacro switch-define-types ( parent &rest t-list)
  343.  
  344.   (let
  345.     (
  346.       (code NIL)
  347.     )
  348.  
  349.     (dolist (ty t-list)
  350.       (push
  351.         (if *define-type-switch*
  352.           `(define-type ,ty ,@(if parent `((:inherit-from ,parent)) NIL))
  353.           `(ndefstruct (,ty (:class class) ,@(if parent `((:include (,parent))) `() ) )  )
  354.         )
  355.         code
  356.       )
  357.     )
  358.  
  359.     `(progn
  360.        ,@code
  361.     )
  362.  
  363.   )
  364. ) ;switch-define-types
  365.  
  366. ;;switch-define-method-Define method depending on switch
  367.  
  368. (defmacro switch-define-method (name)
  369.  
  370.   (if *define-type-switch*
  371.     `(define-method (,name ,(intern (symbol-name name) (find-package 'keyword)) ) () )
  372.     `(defmeth ,(intern (symbol-name name) co::*keyword-standin-package*)
  373.        ((.inner-self. ,name))
  374.      )
  375.   )
  376.  
  377. ) ;switch-define-method
  378.  
  379. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  380. ; Define Types For Method Definition Tests and Make Instances
  381. ;
  382. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  383.  
  384. ;;For testing method definition and invocation with varying methods on
  385. ;;  discriminator
  386.  
  387. (funcall 
  388.   (compile () 
  389.     `(lambda () (switch-define-types NIL temp0 temp1 temp2 temp3 temp4))
  390.   )
  391. )
  392.  
  393. (setf temp0 (make-instance 'temp0))
  394. (setf temp1 (make-instance 'temp1))
  395. (setf temp2 (make-instance 'temp2))
  396. (setf temp3 (make-instance 'temp3))
  397. (setf temp4 (make-instance 'temp4))
  398.  
  399. ;;For testing method invocation of inherited methods
  400.  
  401. (funcall 
  402.   (compile () 
  403.     `(lambda () (switch-define-types NIL g3f))
  404.   )
  405. )
  406.  
  407. (funcall 
  408.   (compile () 
  409.     `(lambda () (switch-define-method g3f))
  410.   )
  411. )
  412.  
  413. (funcall 
  414.   (compile () 
  415.     `(lambda () (switch-define-types g3f g2f))
  416.   )
  417. )
  418.  
  419. (funcall 
  420.   (compile () 
  421.     `(lambda () (switch-define-method g2f))
  422.   )
  423. )
  424.  
  425. (funcall 
  426.   (compile () 
  427.     `(lambda () (switch-define-types g2f g1f))
  428.   )
  429. )
  430.  
  431. (funcall 
  432.   (compile () 
  433.     `(lambda () (switch-define-method g1f))
  434.   )
  435. )
  436.  
  437. (funcall 
  438.   (compile () 
  439.     `(lambda () (switch-define-types g1f g0f))
  440.   )
  441. )
  442.  
  443. (funcall 
  444.   (compile () 
  445.     `(lambda () (switch-define-method g0f))
  446.   )
  447. )
  448.  
  449. ;;Make an instance of g0f
  450.  
  451. (setf g0f (make-instance 'g0f))
  452.  
  453. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  454.  
  455. ;;Method symbol List
  456.  
  457. (defvar *list-of-method-symbols* NIL)
  458.  
  459. ;;do-method-definition-Do the method definition
  460.  
  461. (defmacro do-method-definition (record  predefined fortype)
  462.  
  463.   (let
  464.     (
  465.       (code NIL)
  466.     )
  467.  
  468.     ;;Generate a new function symbol
  469.  
  470.     (push (gensym) *function-symbols*)
  471.  
  472.     ;;Generate method symbols if necessary
  473.  
  474.     (if (not *list-of-method-symbols*)
  475.  
  476.       (dotimes (i 20)
  477.         (push (intern (format NIL "T~D" i) (find-package :keyword))
  478.           *list-of-method-symbols*
  479.         )
  480.       )
  481.     ) ;if
  482.  
  483.     ;;Generate code for method definition
  484.  
  485.     (dolist (l *list-of-method-symbols*)
  486.  
  487.       (push 
  488.         (if *define-type-switch*
  489.           `(define-method (,fortype ,l) ()  ) 
  490.           `(defmeth ,(intern (symbol-name l) co::*keyword-standin-package*) 
  491.              ((.inner-self. ,fortype)) 
  492.            )
  493.          )
  494.          code
  495.       )
  496.  
  497.     )
  498.  
  499.     ;;Return code, inserting prolog and cache heating
  500.  
  501.   `(defun ,(first *function-symbols*) ()
  502.     (let
  503.        (
  504.          (after 0)
  505.          (before 0)
  506.          (sum 0)
  507.        )
  508.  
  509.        (tagbody
  510.        again
  511.          (do-garbage-collect)
  512.  
  513.          ,(if *define-type-switch*
  514.            `(define-method (,fortype ,(gentemp)) ()  ) 
  515.            `(defmeth ,(gentemp) ((.inner-self. ,fortype)) )
  516.          )
  517.  
  518.          (setf before (get-time))
  519.          (macro-start-clock)
  520.          ,@code
  521.      (macro-end-clock)
  522.          (setf after (get-time))
  523.  
  524.          (setf sum (macro-insert-sum))
  525.  
  526.          (if (< (the integer after) (the integer before))
  527.            (go again)
  528.          )
  529.        )
  530.  
  531.        (if ,record
  532.          (push (list 20 ,predefined (- after before) sum) *define-method-results*)
  533.        )
  534.  
  535.       )
  536.  
  537.     )
  538.  
  539.   ) ;let
  540.  
  541. ) ;do-method-definition
  542.  
  543. (setf (symbol-function 'do-method-definition-macro) (macro-function 'do-method-definition))
  544. (compile 'do-method-definition-macro)
  545. (setf (macro-function 'do-method-definition) (symbol-function 'do-method-definition-macro))
  546.  
  547. ;;do-messaging-Messaging macro code construction
  548.  
  549. (defmacro do-messaging (record predefined &rest type-list)
  550.  
  551.   (let
  552.     (
  553.       (code NIL)
  554.     )
  555.  
  556.     ;;Generate a new function symbol
  557.  
  558.     (push (gensym) *function-symbols*)
  559.  
  560.     ;;Push on 20 messagings
  561.  
  562.     (dotimes (i 20)
  563.  
  564.       ;;Message for each type      
  565.  
  566.       (dolist (ty type-list)
  567.  
  568.          (push 
  569.            (if *define-type-switch*
  570.              `(=> ,ty ,(first *list-of-method-symbols*))
  571.              `(,(intern 
  572.                 (symbol-name (first *list-of-method-symbols*)) 
  573.                 co::*keyword-standin-package*
  574.                )
  575.                ,ty
  576.               )
  577.             )
  578.             code
  579.  
  580.          ) ;push
  581.  
  582.       ) ;dolist
  583.  
  584.     ) ;dotimes
  585.  
  586.     ;;Return code, inserting prolog and hardware cache
  587.     ;;  heating to another message.
  588.  
  589.   `(defun ,(first *function-symbols*) ()
  590.     (let
  591.        (
  592.          (after 0)
  593.          (before 0)
  594.          (sum 0)
  595.        )
  596.  
  597.        (tagbody
  598.        again
  599.  
  600.          (do-garbage-collect)
  601.  
  602.          ,(if *define-type-switch*
  603.            `(=> ,(first type-list) ,(second *list-of-method-symbols*))
  604.            `(,(intern 
  605.               (symbol-name (second *list-of-method-symbols*)) 
  606.               co::*keyword-standin-package*
  607.              )
  608.              ,(first type-list)
  609.             )
  610.           )
  611.  
  612.  
  613.          (setf before (get-time))
  614.          (macro-start-clock)
  615.          ,@code
  616.          (macro-end-clock)
  617.          (setf after (get-time))
  618.  
  619.          (setf sum (macro-insert-sum))
  620.  
  621.          (if (< (the integer after) (the integer before))
  622.            (go again)
  623.          )
  624.        )
  625.  
  626.        (if ,record
  627.           (push (list (* 20 ,(length type-list)) 
  628.               ,predefined
  629.                   (- after before)
  630.                       sum
  631.                  )
  632.                  *messaging-results*
  633.           )
  634.        )
  635.  
  636.       )
  637.  
  638.     )
  639.  
  640.   ) ;let
  641.  
  642. ) ;do-messaging
  643.  
  644. (setf (symbol-function 'do-messaging-macro) (macro-function 'do-messaging))
  645. (compile 'do-messaging-macro)
  646. (setf (macro-function 'do-messaging) (symbol-function 'do-messaging-macro))
  647.  
  648. ;;do-inherited-messaging-Generate code for profiling inherited messaging
  649.  
  650. (defmacro do-inherited-messaging (record level method)
  651.  
  652.   (let
  653.     (
  654.       (code NIL)
  655.     )
  656.  
  657.     ;;Generate a new function symbol
  658.  
  659.     (push (gensym) *function-symbols*)
  660.  
  661.     ;;Push on 20 messagings
  662.  
  663.     (dotimes (i 20)
  664.  
  665.       (push 
  666.         (if *define-type-switch*
  667.           `(=> g0f ,(intern (symbol-name method) (find-package 'keyword)))
  668.           `(,(intern 
  669.                (symbol-name method) 
  670.                co::*keyword-standin-package*
  671.              )
  672.              g0f
  673.           )
  674.         )
  675.         code
  676.  
  677.       ) ;push
  678.  
  679.     ) ;dotimes
  680.  
  681.     ;;Return code, inserting prolog and hardware cache
  682.     ;;  heating to another message.
  683.  
  684.   `(defun ,(first *function-symbols*) ()
  685.     (let
  686.        (
  687.          (after 0)
  688.          (before 0)
  689.          (sum 0)
  690.        )
  691.  
  692.        (tagbody
  693.        again
  694.  
  695.          (do-garbage-collect)
  696.  
  697.          ,(if *define-type-switch*
  698.            `(=> g0f ,(intern (symbol-name method) (find-package 'keyword)))
  699.            `(,(intern 
  700.               (symbol-name method) 
  701.               co::*keyword-standin-package*
  702.              )
  703.              g0f
  704.             )
  705.           )
  706.  
  707.  
  708.          (setf before (get-time))
  709.          (macro-start-clock)
  710.           ,@code
  711.          (macro-end-clock)
  712.          (setf after (get-time))
  713.  
  714.          (setf sum (macro-insert-sum))
  715.  
  716.          (if (< (the integer after) (the integer before))
  717.            (go again)
  718.          )
  719.        )
  720.  
  721.        (if ,record
  722.          (push (list 20 ,level (- after before) sum) *inherited-messaging-results*)
  723.        )
  724.  
  725.       )
  726.  
  727.     )
  728.  
  729.   ) ;let
  730.  
  731. ) ;do-inherited-messaging
  732.  
  733. (setf (symbol-function 'do-inherited-messaging-macro) (macro-function 'do-inherited-messaging))
  734. (compile 'do-inherited-messaging-macro)
  735. (setf (macro-function 'do-inherited-messaging) (symbol-function 'do-inherited-messaging-macro))
  736.  
  737. ;;print-results-Print the results to the file
  738.  
  739. (defun print-results (filename fromwho)
  740.  
  741.   (with-open-file
  742.     (istream filename :direction :output 
  743.               :if-exists :append 
  744.               :if-does-not-exist :create
  745.     )
  746.     
  747.     (format istream "~%~%~A~%~%" fromwho)
  748.     (format istream "~%~%Times are in msec. Clock increment:~F~%~%" *clock-increment-in-milliseconds*)
  749.  
  750.  
  751.  
  752.     (format istream "~1,8@T~1,8@T~1,8@TMacroexpand Times~%~%")
  753.     (format istream 
  754.             "Operation~1,8@TSlots~1,8@TParents~1,8@TIterations~1,8@TTotal Time~1,8@TTime per Call~%~%"
  755.     )
  756.     (dolist (l (reverse *define-type-results*))
  757.       (format istream 
  758.               "Define Type~1,8@T~D~1,8@T~D~1,8@T~D~1,8@T~1,8@T~8,2F~1,8@T~8,2F~%" 
  759.               (second l)
  760.               (third l)
  761.               (first l)
  762.               (* (fifth l) *clock-increment-in-milliseconds*)
  763.               (* (float (/ (fifth l) (first l))) *clock-increment-in-milliseconds*)
  764.        )
  765.     )
  766.     (format istream 
  767.             "~%~%Operation~1,8@TIterations~1,8@TFunctions~1,8@TTotal Time~1,8@TTime per Call~%~%"
  768.     )
  769.     (dolist (l (reverse *define-method-results*))
  770.       (format istream 
  771.               "Define Operation~1,8@T~D~1,8@T~D~1,8@T~1,8@T~8,2F~1,8@T~8,2F~%" 
  772.               (first l)
  773.               (second l)
  774.               (* (fourth l) *clock-increment-in-milliseconds*)
  775.               (* (float (/ (fourth l) (first l))) *clock-increment-in-milliseconds*)
  776.        )
  777.     )
  778.     (dolist (l (reverse *messaging-results*))
  779.       (format istream 
  780.               "Operation Invocation~1,8@T~D~1,8@T~D~1,8@T~1,8@T~8,2F~1,8@T~8,2F~%" 
  781.               (first l)
  782.               (second l)
  783.               (* (fourth l) *clock-increment-in-milliseconds*)
  784.               (* (float (/ (fourth l) (first l))) *clock-increment-in-milliseconds*)
  785.        )
  786.     )
  787.     (format istream "~|")
  788.  
  789.  
  790.     (format istream "~%~%~A~%~%" fromwho)
  791.     (format istream "~%~%All Times in msec~%~%")
  792.  
  793.     (format istream "~1,8@T~1,8@T~1,8@TType Definition and Instance Creation~%~%")
  794.     (format istream 
  795.             "Operation~1,8@TSlots~1,8@TParents~1,8@TIterations~1,8@TTotal Time~1,8@TTime per Call~%~%"
  796.     )
  797.     (dolist (l (reverse *define-type-results*))
  798.       (format istream 
  799.               "Define Type~1,8@T~D~1,8@T~D~1,8@T~D~1,8@T~1,8@T~8,2F~1,8@T~8,2F~%" 
  800.               (second l)
  801.               (third l)
  802.               (first l)
  803.               (* (fourth l) *clock-increment-in-milliseconds*)
  804.               (* (float (/ (fourth l) (first l))) *clock-increment-in-milliseconds*)
  805.        )
  806.     )
  807.  
  808.     (dolist (l (reverse *creation-results*))
  809.       (format istream 
  810.               "Create Instance~1,8@T~D~1,8@T~D~1,8@T~D~1,8@T~1,8@T~8,2F~1,8@T~8,2F~%" 
  811.               (second l)
  812.               (third l)
  813.               (first l)
  814.               (* (fourth l) *clock-increment-in-milliseconds*)
  815.               (* (float (/ (fourth l) (first l))) *clock-increment-in-milliseconds*)
  816.        )
  817.     )
  818.  
  819.     (format istream "~%~%~1,8@T~1,8@TOperation Creation and Invocation~%~%")
  820.     (format istream 
  821.             "Operation~1,8@TIterations~1,8@TFunctions~1,8@TTotal Time~1,8@TTime per Call~%~%"
  822.     )
  823.     (dolist (l (reverse *define-method-results*))
  824.       (format istream 
  825.               "Define Operation~1,8@T~D~1,8@T~D~1,8@T~1,8@T~8,2F~1,8@T~8,2F~%" 
  826.               (first l)
  827.               (second l)
  828.               (* (third l) *clock-increment-in-milliseconds*)
  829.               (* (float (/ (third l) (first l))) *clock-increment-in-milliseconds*)
  830.        )
  831.     )
  832.  
  833.     (dolist (l (reverse *messaging-results*))
  834.       (format istream 
  835.               "Operation Invocation~1,8@T~D~1,8@T~D~1,8@T~1,8@T~8,2F~1,8@T~8,2F~%" 
  836.               (first l)
  837.               (second l)
  838.               (* (third l) *clock-increment-in-milliseconds*)
  839.               (* (float (/ (third l) (first l))) *clock-increment-in-milliseconds*)
  840.        )
  841.     )
  842.  
  843.     (format istream "~%~%~1,8@T~1,8@TInherited Operation Invocation~%~%")
  844.     (format istream 
  845.             "Operation~1,8@TIterations~1,8@TParents~1,8@TTotal Time~1,8@TTime per Call~%~%"
  846.     )
  847.  
  848.     (dolist (l (reverse *inherited-messaging-results*))
  849.       (format istream 
  850.               "Operation Invocation~1,8@T~D~1,8@T~D~1,8@T~1,8@T~8,2F~1,8@T~8,2F~%" 
  851.               (first l)
  852.               (second l)
  853.               (* (third l) *clock-increment-in-milliseconds*)
  854.               (* (float (/ (third l) (first l))) *clock-increment-in-milliseconds*)
  855.        )
  856.     )
  857.     (format istream "~|")
  858.   ) ;with-open-file
  859.  
  860.   (setf *define-type-results* NIL)
  861.   (setf *creation-results* NIL)
  862.   (setf *define-method-results* NIL)
  863.   (setf *messaging-results* NIL)
  864.   (setf *inherited-messaging-results* NIL)
  865.  
  866. ) ;print-results
  867.  
  868. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  869.  
  870. (provide "co-profmacs")
  871.  
  872.