guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to read integers from file faster?


From: Ludovic Courtès
Subject: Re: How to read integers from file faster?
Date: Sat, 31 Aug 2013 12:19:09 +0200
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Andy Wingo <address@hidden> 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 there’s a fast path for that (not using
iconv) in 2.0:

  (with-fluids ((%default-port-encoding "UTF-8"))
    (call-with-input-file file
      ...))

Ludo’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]