[gambit-list] Speed on XML-parsing

David Rush kumoyuki at gmail.com
Sat Aug 16 02:32:04 EDT 2008


On Sat, Aug 16, 2008 at 1:45 AM, Bradley Lucier <lucier at math.purdue.edu> wrote:
> On Aug 15, 2008, at 7:08 PM, Hans Petter Egesund wrote:
>> Clues on this one?

> If you follow the thread spread between subthreads starting...
> you'll see that IO using read-char and write-char is slow; that's
> hard to fix.

Yes. I've had this problem with a number of schemes. Depending on the
size of your file, reading the whole thing as a string and *then*
running the rest of your program on a string-port (instead of a plain
input-port) can give you a fair bit of speed increase. There are
deeper hacks you can use to avoid allocator churn while reading the
file, but these can be very dependent on the specfic implementation.

Another thing I did on one project was develop a preprocessor which
converted my XML files to SXML format. Since READ is highly optimized
in most Scheme readers it made the actual data processing go very
fast. This had the added advantage that I was able to break my
dependency on SSAX.

Just some thoughts. Remember, memory is cheap these days.

david
-- 
GPG Public key at http://cyber-rush.org/drr/gpg-public-key.txt



More information about the Gambit-list mailing list