Commit d7166fcd authored by Daniel Kochmański's avatar Daniel Kochmański

files: update aux files

parent 9cd7308e
......@@ -4,7 +4,7 @@ Name: Metering
Summary: Portable Code Profiling Tool
Version: v2.1 (25-JAN-94)
Version: v3.0 (2016-02-26)
......@@ -29,12 +29,14 @@ Updated:
CD-ROM: Prime Time Freeware for AI, Issue 1-1
Bug Reports:
Bug Reports:
Mailing List:
Mailing List:
Author(s): Mark Kantrowitz <>
Maintainer: Daniel Kochmański <>
......@@ -42,7 +44,7 @@ Keywords:
Lisp!Tools, Metering, Profiler, Authors!Kantrowitz, Time Measurement,
Code Profiler, Space Usage Measurement, CMU, Public Domain
Contains: ???
See Also:
<TITLE>Package: lang/lisp/code/tools/metering/</TITLE>
<b>CMU Artificial Intelligence Repository</b><br>
<tt><A HREF="/afs/"><IMG ALIGN=MIDDLE SRC="/afs/" ALT="Home"></A> <A HREF="/afs/"><IMG ALIGN=MIDDLE SRC="/afs/" ALT="INFO"></A> <A HREF="/afs/"><IMG ALIGN=MIDDLE SRC="/afs/" ALT="Search"></A> <A HREF="/afs/"><IMG ALIGN=MIDDLE SRC="/afs/" ALT="FAQs"></A> <A HREF="/afs/"><IMG ALIGN=MIDDLE SRC="/afs/" ALT="Repository Root"></A> </tt>
<H2>Metering: Portable Code Profiling Tool</H2>
<A HREF="./">lang/lisp/code/tools/metering/</A>
METERING is a portable code profiling tool, for gathering timing and
consing statistics while a program is running. This is a combination
of the Monitor package written by Chris McConnell and the Profile
package written by Skef Wholey and Rob MacLachlan, with several
extensions. Monitors the use of functions and macros: calls, CPU
time, clock time, and storage use.
CMU Lisp Repository (home location)
Version: v2.1 (25-JAN-94)
Requires: Common Lisp
Ports: Portable, with three small implementation-dependent
changes for new Common Lisp implementations. Tested in
CMU CL, MACL, MCL, Allegro CL, Lucid CL, AKCL, IBCL.
Copying: Public domain.
CD-ROM: Prime Time Freeware for AI, Issue 1-1
Bug Reports:
Mailing List:
Author(s): Mark Kantrowitz <>
Authors!Kantrowitz, CMU, Code Profiler, Lisp!Tools, Metering,
Profiler, Public Domain, Space Usage Measurement,
Time Measurement
Documentation of the tools written by Mark Kantrowitz (Metering,
Defsystem, Source Compare, User Manual, and Xref) appears in
Mark Kantrowitz, "Portable Utilities for Common Lisp, User Guide and
Implementation Notes", Tech Report CMU-CS-91-143, School of Computer
Science, Carnegie Mellon University, May 1991.
which is available as lang/lisp/code/tools/mkantdoc.tar.gz.
There is also some documentation at the top of the file.
<address>Last Web update on Mon Feb 13 10:30:49 1995 <br>
<A HREF="/afs/"></A></address>
Return-Path: <brunk@ruffles.ICS.UCI.EDU>
Received: by A.GP.CS.CMU.EDU id aa17156; 28 Jun 94 13:48:44 EDT
Received: from GLINDA.OZ.CS.CMU.EDU by A.GP.CS.CMU.EDU id aa17075;
28 Jun 94 13:43:38 EDT
Received: from by GLINDA.OZ.CS.CMU.EDU id aa11297;
28 Jun 94 13:42:15 EDT
Received: from by id aa10848;
28 Jun 94 10:41 PDT
Subject: Common Lisp Metering System
Date: Tue, 28 Jun 1994 10:41:32 -0700
From: Cliff Brunk <brunk@ruffles.ICS.UCI.EDU>
Message-ID: <>
Hi Mark,
I use your Common Lisp metering system pretty often on under MCL 2.01.
Thanks for making this nice profiling tool available, it has helped alot.
However, I notied that the amount of space used by functions that contain
an &optional is much higher for the monitoring-encapsulation than
from the original function. I beleive this is because the encapsulation
creates a list for the optional arguments using &rest. If one adds
a dynmaic-extentent declaration after the lambda list in many implementations
of Common Lisp the &rest arglist will be stack allocated and the amount of
storage reported will be a truer indication of how the function performs
outside of the encapsulation. Below is the modification that I'm currently
using and seems to work at least under MCL.
Cliff Brunk
(defun make-monitoring-encapsulation (min-args optionals-p)
(let (required-args)
(dotimes (i min-args) (push (gensym) required-args))
`(lambda (name)
(let ((inclusive-time 0)
(inclusive-cons 0)
(exclusive-time 0)
(exclusive-cons 0)
(calls 0)
(nested-calls 0)
(old-definition (place-function name)))
(declare (type time-type inclusive-time)
(type time-type exclusive-time)
(type consing-type inclusive-cons)
(type consing-type exclusive-cons)
(fixnum calls)
(fixnum nested-calls))
(pushnew name *monitored-functions*)
(setf (place-function name)
#'(lambda (,@required-args
,@(when optionals-p `(&rest optional-args)))
,(when optionals-p `(declare (dynamic-extent optional-args))) ;;; &rest optional-args can be stack allocated
(let ((prev-total-time *total-time*)
(prev-total-cons *total-cons*)
(prev-total-calls *total-calls*)
; (old-time inclusive-time)
; (old-cons inclusive-cons)
; (old-nested-calls nested-calls)
(start-time (get-time))
(start-cons (get-cons)))
(declare (type time-type prev-total-time)
(type time-type start-time)
(type consing-type prev-total-cons)
(type consing-type start-cons)
(fixnum prev-total-calls))
,(if optionals-p
`(apply old-definition
,@required-args optional-args)
`(funcall old-definition ,@required-args))
(let ((delta-time (- (get-time) start-time))
(delta-cons (- (get-cons) start-cons)))
;; Calls
(incf calls)
(incf *total-calls*)
;;; nested-calls includes this call
(incf nested-calls (the fixnum
(- *total-calls*
; (setf nested-calls (+ old-nested-calls
; (- *total-calls*
; prev-total-calls)))
;; Time
;;; Problem with inclusive time is that it
;;; currently doesn't add values from recursive
;;; calls to the same function. Change the
;;; setf to an incf to fix this?
(incf inclusive-time (the time-type delta-time))
; (setf inclusive-time (+ delta-time old-time))
(incf exclusive-time (the time-type
(+ delta-time
(- prev-total-time
(setf *total-time* (the time-type
(+ delta-time
;; Consing
(incf inclusive-cons (the consing-type delta-cons))
; (setf inclusive-cons (+ delta-cons old-cons))
(incf exclusive-cons (the consing-type
(+ delta-cons
(- prev-total-cons
(setf *total-cons*
(the consing-type
(+ delta-cons prev-total-cons))))))))
(setf (get-monitor-info name)
:name name
:old-definition old-definition
:new-definition (place-function name)
:read-metering #'(lambda ()
(values inclusive-time
:reset-metering #'(lambda ()
(setq inclusive-time 0
inclusive-cons 0
exclusive-time 0
exclusive-cons 0
calls 0
nested-calls 0)
Cliff Brunk I'm not really listening. It's all non-
Information and Computer Science sense. I'm working on a new problem:
University of California Find the value for n such that n plus
Irvine, California 92717-3425 everything else in your life makes you
(714) 725-3491 feel all right. What would n equal? Solve for n. - Peter Cameron
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment