aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/pg-dev.el
diff options
context:
space:
mode:
authorGravatar David Aspinall <da@inf.ed.ac.uk>2010-08-18 12:12:22 +0000
committerGravatar David Aspinall <da@inf.ed.ac.uk>2010-08-18 12:12:22 +0000
commit5d2226b9f31c9e5281db7718c14c4f3dd2642c66 (patch)
tree0d33a1dc00edf24ee8e2aef79a66256924ea3efe /lib/pg-dev.el
parent64da00694c65af10da343f8ffad4a0088c8bb845 (diff)
hack to ELP to give better readability of profile results, in milliseconds
Diffstat (limited to 'lib/pg-dev.el')
-rw-r--r--lib/pg-dev.el23
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/pg-dev.el b/lib/pg-dev.el
index 38c24400..1a204527 100644
--- a/lib/pg-dev.el
+++ b/lib/pg-dev.el
@@ -1,6 +1,6 @@
;;; pg-dev.el --- Developer settings for Proof General
;;
-;; Copyright (C) 2008, 2009 LFCS Edinburgh.
+;; Copyright (C) 2008, 2009, 2010 LFCS Edinburgh.
;; Author: David Aspinall <David.Aspinall@ed.ac.uk> and others
;; License: GPL (GNU GENERAL PUBLIC LICENSE)
;;
@@ -115,6 +115,7 @@
;; Proling interesting packages
;;
+;;;###autoload
(defun profile-pg ()
(interactive)
(elp-instrument-package "proof-")
@@ -127,10 +128,26 @@
(elp-instrument-package "replace-") ; for replace-regexp etc
(elp-instrument-package "re-search-") ; for re-search-forwad etc
(elp-instrument-package "skip-chars-") ; for skip chars etc
- (elp-instrument-function 'string-match)
- (elp-instrument-function 'match-string)
+ (elp-instrument-list
+ '(string-match match-string re-search-forward re-search-backward
+ skip-chars-forward skip-chars-backward
+ goto-char insert
+ set-marker marker-position
+ nreverse nconc mapc
+ member
+ redisplay
+ sit-for
+ overlay-put overlay-start overlay-end make-overlay
+ buffer-live-p kill-buffer
+ process-status get-buffer-process
+ delete-overlay move-overlay))
(elp-instrument-package "font-lock"))
+;; improve readability of profile results, give milliseconds
+(defun elp-pack-number (number width)
+ (format (concat "%" (number-to-string (- width 3)) ".2f")
+ (* 100 (string-to-number number))))
+
;;
;; Make references to bugs clickable; [e.g., trac #1]