mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-10 14:00:21 +02:00
poor man's statprof integration with the repl: ,pr
* module/system/repl/command.scm (profile): Add a very poor integration of statprof with the repl.
This commit is contained in:
parent
500f6a47e2
commit
a6dc56a71e
1 changed files with 7 additions and 5 deletions
|
@ -36,6 +36,7 @@
|
|||
#:use-module (ice-9 documentation)
|
||||
#:use-module (ice-9 and-let-star)
|
||||
#:use-module (ice-9 rdelim)
|
||||
#:use-module (statprof)
|
||||
#:export (meta-command))
|
||||
|
||||
|
||||
|
@ -359,13 +360,14 @@ Time execution."
|
|||
(get identity gc-start gc-end))
|
||||
result))
|
||||
|
||||
(define-meta-command (profile repl form . opts)
|
||||
(define-meta-command (profile repl (form) . opts)
|
||||
"profile FORM
|
||||
Profile execution."
|
||||
(apply vm-profile
|
||||
(repl-vm repl)
|
||||
(repl-compile repl (repl-parse repl form))
|
||||
opts))
|
||||
;; FIXME opts
|
||||
(let ((vm (repl-vm repl))
|
||||
(proc (make-program (repl-compile repl (repl-parse repl form)))))
|
||||
(with-statprof #:hz 100 (vm proc))))
|
||||
|
||||
|
||||
|
||||
;;;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue