profile.lisp 965 B

1234567891011121314151617181920212223
  1. ;;; -*- Mode: Lisp; show-trailing-whitespace: t; Base: 10; indent-tabs: nil; Syntax: ANSI-Common-Lisp; Package: CL-USER; -*-
  2. ;;; Copyright (c) 2013, Mark VandenBrink. All rights reserved.
  3. ;;;;;;;;;;;;;;;;;;;; Handy, dandy CCL profile functions ;;;;;;;;;;;;;;;;;;;;
  4. ;;;
  5. ;;; Usage: load and compile this file, then at REPL, type "profile-on". After
  6. ;;; running programs, type "profile-report" to get a profile listing.
  7. ;;; "profile-reset" clears counters
  8. ;;; "profil-off" turns of profiling
  9. (defun profile-on ()
  10. (dolist (p '("MP4-ATOM" "MPEG" "AUDIO-STREAMS" "ID3-FRAME" "UTILS" "LOGGING" "ISO-639-2" "MP3-TAG" "MP4-TAG" "FLAC-FRAME"))
  11. (let ((pkg (find-package p)))
  12. (mon:monitor-all pkg)
  13. (format t "Package ~a, ~:d~%" pkg (length mon:*monitored-functions*)))))
  14. (defun profile-report ()
  15. (mon:report :nested :inclusive :threshold 0.0 :names :all))
  16. (defun profile-reset ()
  17. (mon:reset-all-monitoring))
  18. (defun profile-off ()
  19. (mon:unmonitor))