Re: How to read integers from file faster?

2013-08-31 Thread Mark H Weaver
Darren Hoo writes: > It is way too slow to read numbers from a file simply by using `read' Indeed. Looking at the code, I can see a lot of room for improvement, especially in 'string->number' (which is used also by 'read'). I've added an item to my TODO list to optimize this. Hopefully by 2.0

Re: How to read integers from file faster?

2013-08-31 Thread Andy Wingo
On Sat 31 Aug 2013 05:55, Darren Hoo writes: > (define (read-test1) > (with-input-from-file > "rnd.txt" > (lambda () > (let lp ((i (read))) > (if (not (eof-object? i)) > (lp (read))) > > scheme@(guile-user)> ,time (read-test1) > ;; 37

Re: How to read integers from file faster?

2013-08-31 Thread Ludovic Courtès
Andy Wingo skribis: > I just took a look at your program, which ran in 40s on my machine. > Under callgrind it turned out that we were doing a lot of iconv stuff > that we didn't need to do. It’s often the case that I/O is faster if you explicitly say that the port is UTF-8-encoded, because ther