All Manuals > LispWorks® User Guide and Reference Manual > 37 The HCL Package

start-gc-timing

stop-gc-timing

get-gc-timing Functions

Summary

Time Garbage Collector (GC) operations.

Package

hcl

Signatures

start-gc-timing &key initialize

stop-gc-timing

get-gc-timing &key reset

Arguments
initialize
A generalized boolean.
reset
A generalized boolean.
Description

The functions start-gc-timing, stop-gc-timing and get-gc-timing time Garbage Collector (GC) operations.

start-gc-timing causes the system to start collecting GC timing. If initialize is non-nil, start-gc-timing also resets the Garbage Collector times to 0. The default value of initialize is t.

stop-gc-timing stops collecting GC timing, but does not affect the times.

get-gc-timing returns the GC timing as a plist of the form:

(:total total :user user :system system)

where total, user and system are real numbers giving the total, user and system times in seconds spent inside the Garbage Collector while GC timing is on since the timing was last reset. When reset is non-nil, get-gc-timing also switches GC timing off and resets the timing to 0. The default value of reset is nil.

The GC timing is the same timing that is collected by extended-time. Once start-gc-timing is called, extended-time does not try to collect GC timing and print it until get-gc-timing is called with reset non-nil.

get-gc-timing can be called while GC timing is being collected.

Notes

stop-gc-timing and start-gc-timing (with initialize = nil) can be used to collect GC timing only in specific periods without resetting the times. However the points at which the Garbage Collector is invoked are not well-defined, so the program may allocate while GC timing is on, and spend time Garbage Collecting after you stopped collecting.

See also

extended-time
room
time


LispWorks® User Guide and Reference Manual - 01 Dec 2021 19:30:35