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: Sun, 01 Sep 2013 15:33:54 +0200
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Andy Wingo <address@hidden> skribis:

> On Sat 31 Aug 2013 12:19, address@hidden (Ludovic Courtès) writes:
>
>> 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
>>       ...))
>
> Yep.  In this particular case, it turned out that even in UTF-8 locales,
> scm_ungetc_unlocked and scm_from_port_string were going through iconv.

Aah, ungetc, OK.

Ludo’.



reply via email to

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