the-cost-of-nothing

API Reference

the-cost-of-nothing

Determine the cost of things in Common Lisp.

THE-COST-OF-NOTHING

  • Function WRITE-SI-UNIT (quantity unit stream)
  • Function PRINT-TIME (time &optional (stream *standard-output*))
  • Struct MEASUREMENT
    VALUE
    NAME
    CONTEXT
    TIMESTAMP
  • Function MEASUREMENTP (object)
  • Function MEASUREMENT-VALUE (instance)
  • Function (setf MEASUREMENT-VALUE) (value instance)
  • Function MEASUREMENT-NAME (instance)
  • Function (setf MEASUREMENT-NAME) (value instance)
  • Function MEASUREMENT-CONTEXT (instance)
  • Function (setf MEASUREMENT-CONTEXT) (value instance)
  • Function MEASUREMENT-TIMESTAMP (instance)
  • Function (setf MEASUREMENT-TIMESTAMP) (value instance)
  • Function MAKE-MEASUREMENT (value name)
  • Macro MONITOR (form &key (name `',form))
    Monitor VALUE by storing a measurement in *MEASUREMENTS*. If *MEASUREMENTS* is NIL, no measurement is recorded. The keyword argument NAME can be used to describe the nature of the measurement. The default name of an measurement is the VALUE form that is the first argument of this macro.
  • Struct MONITORING-REGION-START
    A measurement that is only emitted when entering a monitoring region. Its value is the corresponding monitoring region end, or NIL, when the region is still active.
    No slots.
  • Struct MONITORING-REGION-END
    A measurement that is only emitted when leaving a monitoring region. Its value is the corresponding monitoring region start.
    No slots.
  • Macro WITH-MONITORING-REGION ((name) &body body)
    Execute BODY in a region monitoring NAME. This entails the following things: 1. The special variable *MEASUREMENTS* is bound to itself, to ensure that it has the same value throughout the entire monitoring block. 1. An MONITORING-REGION-START measurement is stored right before executing BODY. Its value is NIL initially, but later set to the corresponding MONITORING-REGION-END measurement. 2. For the dynamic extent of BODY, NAME is prepended to the context of all measurements. 3. A MONITORING-REGION-END measurement is stored once control is transferred outside of BODY. Its value is the corresponding MONITORING-REGION-START measurement.
  • Function TOUCH (object)
    Protect OBJECT from compiler optimization.
  • Macro BENCH (form &rest args &key max-samples min-sample-time timeout overhead)
    Evaluate FORM multiple times and print the averaged execution time to *TRACE-OUTPUT*. Examples: (bench nil) => 0.00 nanoseconds (bench (make-hash-table)) => 247.03 nanoseconds
  • Macro BENCHMARK (form &rest args &key max-samples min-sample-time timeout overhead)
    Execute BODY multiple times to accurately measure its execution time in seconds. The returned values are literally the same as those from an invocation of MEASURE-EXECUTION-TIME with suitable lambdas. Examples: (benchmark (cons nil nil)) -> 3.3d-9 1.0 36995264 (benchmark (gc :full t)) -> 0.031 0.9 90
  • Function BENCHMARK-THUNK (thunk &key (timeout 2.0) (min-sample-time *default-min-sample-time*) (max-samples (/ timeout min-sample-time)) (overhead *default-overhead*))
  • Function CONS-COST
  • Function MAKE-LIST-COST (size &key (initial-element nil))
  • Function MAKE-SEQUENCE-COST (result-type length &key (initial-element nil))
  • Function GC-COST (&key full)
  • Function FUNCALL-COST (&key (mandatory-arguments 0) (optional-arguments 0) (keyword-arguments 0) (rest-arguments 0))
  • Function FLOPS (&key (element-type 'single-float))
  • Function PRINT-REPORT (&optional (stream *standard-output*))