>>>>> "Michael" == Michael Sperber [Mr Preprocessor]
>>>>> <sperber@informatik.uni-tuebingen.de> writes:
Michael> The reason is almost certainly READ-LINE which is written
Michael> in (byte-code-interpreted) Scheme in scsh, whereas I
Michael> assume Guile has a C version.
I was slowly coming to that conclusion myself. I tried the below
alternative, and it's about twice as fast, but that's still kind of
slow. I think the quote at the end of this message (which was
attached automatically and at random; lucky coincidence) ought to put
me in the right frame of mind; scsh still promises to save programmer
time.
(let ((start (time)))
(let ((big-string (call-with-input-file "/tmp/x" port->string))
(parser (infix-splitter (rx #\newline))))
;; if you comment this out, the time taken will drop drastically.
;; This makes me wonder if I/O is actually fast, and it's just
;; regexp execution that's slow.
(parser big-string)
(let ((stop (time)))
(format #t "Time: ~A seconds ~%" (- stop start))))
(values))
--
Wasting programmer time is the true inefficiency, not wasting machine time.
-- Paul Graham
|