summaryrefslogtreecommitdiff
path: root/geiser/evaluation.scm
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2015-09-10 04:22:10 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2015-09-10 04:22:10 +0200
commit58484400fd3dde3ec28057159ce55f22fcb6c919 (patch)
tree7ec81bca6d63c4afeca8f10c1b0ac19f8f033a67 /geiser/evaluation.scm
parent2f91e2e4efc776a3b8808c534491edaea6642f93 (diff)
downloadgeiser-guile-58484400fd3dde3ec28057159ce55f22fcb6c919.tar.gz
geiser-guile-58484400fd3dde3ec28057159ce55f22fcb6c919.tar.bz2
Speeding up debugger check (addresses #64)
Soooo, the long delay experienced when evaluating long string lists in Guile had nothing to do with the time took by emacs to read the response from the scheme process; that process is always a breeze, no matter or its format or number of newlines. The delay was provoked by an innocent looking function that scans the received string (which includes a prompt at the end as an EOT marker) to check whether Guile (or any other scheme) has just entered the debugger (that's done inside `geiser-con--connection-update-debugging`). For some reason, `string-match` on that kind of string using Guile's regexp for a debug prompt takes forever. Instead of trying to optimize the regular expression, i've just applied it to the *second* line of the received string, which is the one that contains the response's prompt.
Diffstat (limited to 'geiser/evaluation.scm')
-rw-r--r--geiser/evaluation.scm8
1 files changed, 2 insertions, 6 deletions
diff --git a/geiser/evaluation.scm b/geiser/evaluation.scm
index ea4071d..4c87532 100644
--- a/geiser/evaluation.scm
+++ b/geiser/evaluation.scm
@@ -49,11 +49,6 @@
(ge:set-warnings 'none)
-(define (stringify obj)
- (object->string obj
- (lambda (o . ps)
- (pretty-print o (car ps) #:max-expr-width 100))))
-
(define (call-with-result thunk)
(letrec* ((result #f)
(output
@@ -62,7 +57,8 @@
(with-fluids ((*current-warning-port* (current-output-port))
(*current-warning-prefix* ""))
(with-error-to-port (current-output-port)
- (lambda () (set! result (map stringify (thunk))))))))))
+ (lambda () (set! result
+ (map object->string (thunk))))))))))
(write `((result ,@result) (output . ,output)))
(newline)))