[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
re: help to get this running faster
From: |
Brad Knotwell |
Subject: |
re: help to get this running faster |
Date: |
Sat, 2 Sep 2000 20:52:23 -0700 (PDT) |
Hello--
It's not exactly the same script, but I think it does pretty much the same
thing (I changed from a set of nested lists (???) to a single list).
On my machine, it's an order of magnitude faster than the previous
script.
--Brad
(define-module (alto tabreader))
(export load-records)
(use-modules (ice-9 optargs))
(use-modules (ice-9 string-fun)
(define* (load-records fname #&optional (sep #\tab))
(call-with-input-file fname
(lambda (i-stream)
(do ((records '())
(line (read-line i-stream) (read-line i-stream)))
((eof-object? line) records)
(set! records (append records (list (split-discarding-char sep line
list))))))))
;; (load-records "/tmp/h")