• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
        • Defun
        • Verify-guards
        • Table
        • Mutual-recursion
        • Memoize
        • Make-event
        • Include-book
        • Encapsulate
        • Defun-sk
        • Defttag
        • Defstobj
        • Defpkg
        • Defattach
        • Defabsstobj
        • Defchoose
        • Progn
        • Verify-termination
        • Redundant-events
        • Defmacro
        • Defconst
        • Skip-proofs
        • In-theory
        • Embedded-event-form
        • Value-triple
        • Comp
        • Local
        • Defthm
        • Progn!
        • Defevaluator
        • Theory-invariant
        • Assert-event
        • Defun-inline
        • Project-dir-alist
        • Partial-encapsulate
        • Define-trusted-clause-processor
        • Defproxy
        • Defexec
        • Defun-nx
        • Defthmg
        • Defpun
        • Defabbrev
        • Set-table-guard
        • Name
        • Defrec
        • Add-custom-keyword-hint
        • Regenerate-tau-database
        • Defcong
        • Deftheory
        • Defaxiom
        • Deftheory-static
        • Defund
        • Evisc-table
        • Verify-guards+
        • Logical-name
        • Profile
          • Profile-all
          • Profile-ACL2
        • Defequiv
        • Defmacro-untouchable
        • Add-global-stobj
        • Defthmr
        • Defstub
        • Defrefinement
        • Deflabel
        • In-arithmetic-theory
        • Unmemoize
        • Defabsstobj-missing-events
        • Defthmd
        • Fake-event
        • Set-body
        • Defun-notinline
        • Functions-after
        • Macros-after
        • Dump-events
        • Defund-nx
        • Defun$
        • Remove-global-stobj
        • Remove-custom-keyword-hint
        • Dft
        • Defthy
        • Defund-notinline
        • Defnd
        • Defn
        • Defund-inline
        • Defmacro-last
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
      • Interfacing-tools
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Events

Profile

Turn on profiling for one function

NOTE: An alternative to this utility, which has significantly less functionality but doesn't use hons-enabled features of ACL2, may be found in community book books/misc/profiling.lisp. See hons-and-memoization for a general discussion of memoization, on which this profile utility is built, and the related features of hash consing and applicative hash tables.

Profile can be useful in Common Lisp debugging and performance analysis, including examining the behavior of ACL2 functions.

Example:
(profile 'fn)       ; keep count of the calls of fn
(profile 'fn        ; as above, with some memoize options
         :trace t
         :forget t)
(memsum) ; report statistics on calls of memoized functions (e.g., fn)
(clear-memoize-statistics) ; clear memoization (and profiling) statistics

Evaluation of (profile 'fn) redefines fn so that a count will be kept of the calls of FN. The information recorded may be displayed, for example, by invoking (memoize-summary) or (equivalently) (memsum). If you wish to gather fresh statistics for the evaluation of a top-level form, see clear-memoize-statistics.

Profile is just a macro that calls memoize to do its work. Profile gives the two keyword parameters :condition and :recursive of memoize the value nil. Other keyword parameters for memoize, which must not include :condition, :condition-fn, or :recursive, are passed through. To eliminate profiling, use unmemoize; for example, to eliminate profiling for function fn, evaluate (unmemoize 'fn).

Functions profile-all and profile-ACL2 are available for profiling all functions or all ACL2 functions, respectively.

Subtopics

Profile-all
profile essentially all functions
Profile-ACL2
profile essentially all ACL2 functions