Hello, I have a problem with McCLIM and SBCL.
The following McCLIM application (which uses threads through make-process) runs fine with both CMUCL-18e and OpenMCL but desesperatingly slow with SBCL 0.9.5.
Each call to the command "Process" returns almost instantly with OpenMCl and CMUCL but takes at least 5 seconds with SBCL.
Did anyone notice a problem using threads with SBCL?
Thanks for you help, Irène ;;;---------------------------------------------------------------------- (defpackage #:TEST (:use :clim :clim-extensions :clim-lisp))
(in-package test) (defvar *output-stream* nil)
(let ((*n* 0)) (defun pause () (incf *n*) (dotimes (i 100000000) (1+ 1)) (format *standard-output* "f ~A done~%" *n*) ))
(make-command-table 'file-command-table :errorp nil :menu '( ("Process" :command com-process) ("Quit" :command com-quit)))
(define-application-frame test () () (:panes (interactor-pane :interactor) (result-pane (make-pane 'clim-stream-pane :name 'result-pane)) (quit :push-button :label "Quit" :activate-callback #'(lambda (x) (declare (ignore x)) (com-quit)))) (:layouts (default (vertically () quit interactor-pane result-pane))))
(defun run-test (name) (loop for port in climi::*all-ports* do (destroy-port port)) (setq climi::*all-ports* nil) (let* ((frame (make-application-frame name))) (run-frame-top-level frame)))
(defun start () (run-test 'test) 0)
(defmethod default-frame-top-level :before ((frame application-frame) &key (command-parser 'command-line-command-parser) (command-unparser 'command-line-command-unparser) (partial-command-parser 'command-line-read-remaining-arguments-for-partial-command) (prompt "command: ")) (declare (ignore command-parser)) (declare (ignore command-unparser)) (declare (ignore partial-command-parser)) (declare (ignore prompt)) (setf *output-stream* (climi::find-pane-named *application-frame* 'result-pane)))
(define-test-command (com-process :name t) () (clim-sys::make-process (lambda () (let ((*standard-output* *output-stream*)) (pause))) :name "name" ))
(define-test-command (com-quit :name t) () (frame-exit *application-frame*))
Irene DURAND idurand@labri.fr writes:
The following McCLIM application (which uses threads through make-process) runs fine with both CMUCL-18e and OpenMCL but desesperatingly slow with SBCL 0.9.5.
Each call to the command "Process" returns almost instantly with OpenMCl and CMUCL but takes at least 5 seconds with SBCL.
Did anyone notice a problem using threads with SBCL?
I haven't noticed anything like a five-second latency in thread startup.
(let ((*n* 0)) (defun pause () (incf *n*) (dotimes (i 100000000) (1+ 1)) (format *standard-output* "f ~A done~%" *n*) ))
Under normal operation, the loop in this function would be optimized away. Do you have anything in your personal or site-wide sbcl initialization files, such as a global proclamation of a high debug setting? Or any other package which performs such a global proclamation?
I tried your test, and each call to Process finished essentially instantaneously. A screenshot is available at http://www-jcsu.jesus.cam.ac.uk/~csr21/durand-test.png. Putting a call to TIME around the call to (PAUSE) in COM-PROCESS gives output of the form Evaluation took: 0.125 seconds of real time 0.121982 seconds of user run time 0.001 seconds of system run time 0 page faults and 286,448 bytes consed. which is perhaps a little high, but not completely ridiculous for graphical output.
Cheers,
Christophe