aboutsummaryrefslogtreecommitdiffhomepage
path: root/isar/isar-profiling.el
blob: ae8a8f8ce3fcc21fb14225838b8023bab9b0e48d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
;; isar-profiling.el: simple profiling Isar Proof General.
;;
;; You can run these tests by issuing "make profile.isar" in PG home dir.
;;
;; $Id$
;;

(require 'proof-site)
(proof-ready-for-assistant 'isar)

(declare-function isar-tracing:auto-solve-toggle "isar.el")
(declare-function isar-tracing:auto-quickcheck-toggle "isar.el")
(declare-function isar-proof:parallel-proofs-toggle "isar.el")

(require 'pg-autotest)
(require 'pg-dev)

(unless (bound-and-true-p byte-compile-current-file)

  (pg-autotest log ".profile.log")  ; convention

  (pg-autotest timestart 'total)

  (pg-autotest-find-file "etc/isar/AHundredTheorems.thy")
  (pg-autotest eval (proof-shell-ready-prover))
  (pg-autotest eval (isar-tracing:auto-solve-toggle 0)) ; autosolve hammers this!
  (pg-autotest eval (isar-tracing:auto-quickcheck-toggle 0))
  (pg-autotest eval (isar-proof:parallel-proofs-toggle 0))
  (pg-autotest eval (proof-full-annotation-toggle 0))
  (proof-shell-wait)

  ;; Simple profiling test.  Cf TRAC #324
  (pg-autotest timestart)
  (pg-autotest process-wholefile "etc/isar/AHundredTheorems.thy")
  (pg-autotest timetaken)

  ;; Same again with profiling
  (profile-pg)
  (pg-autotest timestart)
  (pg-autotest process-wholefile "etc/isar/AHundredTheorems.thy")
  (pg-autotest timetaken)
  (pg-autotest timestart)
  (pg-autotest process-wholefile "etc/isar/AHundredTheorems.thy")
  (pg-autotest timetaken)
  (pg-autotest timestart)
  (pg-autotest process-wholefile "etc/isar/AHundredProofs.thy")
  (pg-autotest timetaken)
  (elp-results)
  (let ((results 
	 (with-current-buffer "*ELP Profiling Results*"
	   (buffer-string))))
    (with-current-buffer pg-autotest-log
      (goto-char (point-min))
      (insert "ELP Profiling Results: \n" results "\n\n")))

  (pg-autotest exit)

  )