> From: Darren Hoo <darren....@gmail.com>

>It is way too slow to read numbers from a file simply by using `read' 


The problem mostly lies in dealing with the locale or doing utf-8
conversion.  Also, your code creates and destroys a lot of strings.


You could push data through much more quickly if it were binary
and if you didn't create new objects.


(define (read-test1)
  (let* ((p (open-input-file "rnd.txt"))
         (buf (make-bytevector 10 0)))
    (let lp ((i (get-bytevector-n! p buf 0 10)))

      (if (not (eof-object? i))
          (lp (get-bytevector-n p 10))))))

But, alas, knowing that isn't really a solution to your problem.


-Mike


Reply via email to