[gambit-list] fast csv parser (libcsv wrapped for gambit)

Bradley Lucier lucier at math.purdue.edu
Fri Feb 9 17:33:21 EST 2007

On Feb 9, 2007, at 5:08 PM, Phil Dawes wrote:

> Bradley Lucier wrote:
>> On Feb 9, 2007, at 1:36 PM, Phil Dawes wrote:
>>> wrapped libcsv  ~240ms
>>> Marc comma splitter  ~510ms
>>> Phil Bewig csv parser  ~1008ms
>> Just a question---did you compile the Scheme code with the usual  
>> benchmark declarations
>> (declare (standard-bindings)(extended-bindings) 
>> (block)            ;; basically R6RS
>>          (fixnum) (not  
>> safe))                                     ;; I presume there's  
>> only fixnum characters in a line ;-)
> Oops! - good point.
> That brings the Phil Bewig parser down to ~950 ms

Ah, not much.

What happens when you configure gambit with --enable-char-size=1 (the  
default is 4). (I presume the C you're using has one-byte chars.)

Or you could give a URL for your data for others to play with.

(Next I would suggest doing line reads and stepping through the  
characters locally without going through the trampoline required for  
each call to read-char.  It seems that doing your own line buffering  
may be natural for this problem.)


More information about the Gambit-list mailing list