1 (cl:defpackage
#:sb-sprof-test
5 (cl:in-package
#:sb-sprof-test
)
7 ;#+sb-fasteval (setq sb-ext:*evaluator-mode* :compile)
11 (defun test-0 (n &optional
(depth 0))
12 (declare (optimize (debug 3)))
16 (test-0 n
(1+ depth
)))))
19 (with-profiling (:reset t
:max-samples
1000 :report
:graph
)
25 (push (make-array 10) junk
))
28 (defun consing-test ()
29 ;; 0.0001 chosen so that it breaks rather reliably when sprof does not
30 ;; respect pseudo atomic.
31 (with-profiling (:reset t
32 ;; setitimer with small intervals
33 ;; is broken on FreeBSD 10.0
34 ;; And ARM targets are not fast in
35 ;; general, causing the profiling signal
36 ;; to be constantly delivered without
37 ;; making any progress.
38 #-
(or freebsd arm
) :sample-interval
39 #-
(or freebsd arm
) 0.0001
40 #+arm
:sample-interval
#+arm
0.1
41 :report
:graph
:loop nil
)
42 (let ((target (+ (get-universal-time) 15)))
45 (loop while
(< (get-universal-time) target
)
52 ;; For debugging purposes, print output for visual inspection to see if
53 ;; the allocation sequence gets hit in the right places (i.e. not at all
54 ;; in traditional builds, and everywhere if SB-SAFEPOINT-STRICTLY is
56 #+nil
(disassemble #'consalot
)