[Openmcl-devel] A faster read-line

Ron Garret ron at flownet.com
Tue Oct 19 16:43:35 PDT 2010


Thanks.

It seems to be unicode conversion that is taking all the time.  Python yields similar disparities depending on whether you're reading a file opened with open or codecs.open.

READ-SEQUENCE is nice and zippy.

rg

On Oct 19, 2010, at 4:36 PM, Greg Pfeil wrote:

> On 19 Oct 2010, at 19:27, Ron Garret wrote:
> 
>> Without doing anything special, read-line is, empirically, about fifteen times slower than the equivalent C code, even with :external-format :ascii.  (My benchmark is comparing (loop while (read-line f nil nil)) with wc.)  Lisp also seems to be CPU bound during read-line.  What is it doing with all those cycles?  Are there any easy ways to speed this up?  What's the fastest way to ingest a file in CCL?
> 
> I don't know what CCL is doing, but I remember seeing this forever ago: http://www.ymeme.com/slurping-a-file-common-lisp-83.html




More information about the Openmcl-devel mailing list