Changeset 15027


Ignore:
Timestamp:
Oct 17, 2011, 8:44:40 PM (8 years ago)
Author:
gb
Message:

In STANDARD-REPORT-TIME: try harder to make time-related numbers line up,
summarize differently.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lib/misc.lisp

    r14809 r15027  
    462462            (1000000 "microseconds")
    463463            (1000  "milliseconds")))
    464          (width
     464         (iwidth (max (length (format nil "~:D" elapsed-time))
     465                          (length (format nil "~:D" user-time))
     466                          (length (format nil "~:D" system-time))
     467                          (length (format nil "~:D" gc-time))))
     468                     
     469         (fwidth
    465470          (ecase internal-time-units-per-second
    466471            (1000000 6)
    467472            (1000  3)))
     473         (elapsed-seconds (/ elapsed-time internal-time-units-per-second))
     474         (user-seconds (/ user-time internal-time-units-per-second))
     475         (system-seconds (/ system-time internal-time-units-per-second))
     476         (gc-seconds  (/ gc-time internal-time-units-per-second))
     477         (ffield-width (max (length (format nil "~,vF" fwidth elapsed-seconds))
     478                                (length (format nil "~,vF" fwidth user-seconds))
     479                                (length (format nil "~,vF" fwidth system-seconds))
     480                                (length (format nil "~,vF" fwidth gc-seconds))))
    468481         (cpu-count (cpu-count)))
    469     (format s "~&~S took ~:D ~a (~,vF seconds) to run ~%~20twith ~D available CPU core~P."
    470             form elapsed-time units width (/ elapsed-time internal-time-units-per-second) cpu-count cpu-count)
    471     (format s "~&During that period, ~:D ~a (~,vF seconds) were spent in user mode" user-time units width (/ user-time internal-time-units-per-second))
    472     (format s "~&                    ~:D ~a (~,vF seconds) were spent in system mode" system-time units width(/ system-time internal-time-units-per-second))
     482    (format s "~&~S" form)
     483    (format s "~&took ~v:D ~a (~v,vF seconds) to run." iwidth elapsed-time units ffield-width fwidth elapsed-seconds )
    473484    (unless (eql gc-time 0)
    474485      (format s
    475               "~%~:D ~a (~,vF seconds) was spent in GC."
    476               gc-time units width (/ gc-time internal-time-units-per-second)))
     486              "~%~5t~v:D ~a (~v,vF seconds, ~,2f%) of which was spent in GC." iwidth
     487              gc-time units ffield-width fwidth gc-seconds (* 100.0 (/ gc-seconds elapsed-seconds))))
     488    (format s "~&During that period, and with ~D available CPU core~P," cpu-count cpu-count)
     489    (format s "~&~5t~v:D ~a (~v,vF seconds) were spent in user mode" iwidth user-time units ffield-width fwidth user-seconds)
     490    (format s "~&~5t~v:D ~a (~v,vF seconds) were spent in system mode" iwidth system-time units ffield-width fwidth system-seconds)
    477491    (unless (eql 0 bytes-allocated)
    478492      (format s "~% ~:D bytes of memory allocated." bytes-allocated))
Note: See TracChangeset for help on using the changeset viewer.