Re: Safe GC timing
"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]> Thu, 18 Jun 2026 05:25:18 -0700
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
Apart from safety issues - which I will defer to others, like Martin… I have found that unless you can ensure that the entirety of your test takes place in the same thread, your timings will be off. > On Jun 18, 2026, at 03:21, Tim Bradshaw (as tfb at tfeb dot org) <[email protected]> wrote: > > I'm writing a macro to compute GC times (in several implementations, hence I'm only returning total time). > > The guts of it for LW looks like > > (let ((reset nil)) > (unwind-protect > (progn > (enable-gc-timing) > (multiple-value-prog1 > (values (funcall f) (getf (get-gc-timing :reset t) ':total) t) > (setf reset t))) > (unless reset > (get-gc-timing :reset t)))) > > Is this a safe approach? It's obviously not going to compose with anything else which wants to time the GC. > > --tim > > > _______________________________________________ > Lisp Hug - the mailing list for LispWorks users > [email protected] > http://www.lispworks.com/support/lisp-hug.html _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html