XML, Squeak, and speed

Lex Spoon lex at cc.gatech.edu
Fri May 11 19:29:59 UTC 2001


"Richard A. O'Keefe" <ok at atlas.otago.ac.nz> wrote:
> That's a speed ratio of about 80 between my two parsers.
> Now, my parser in C didn't build a tree, and bypasses the stdio
> library in the interests of speed.  Each data character, for
> example, touches memory just four times.
> 

Richard, is much of this time being taken by division into tokens?  If
so, you might want to check out indexOf:startingAt:ifAbsent: and
indexOfAnyOf:startingAt:ifAbsent:, two methods with primitives backing
them.  They were worked on to speed up HTML parsing, so they ought to
help XML, too.

Unfortunately, these methods are still not usable via Stream's, because
the proper API isn't available, and nobody ever got around to
implementing it. The required method would be similar to upTo:, but it
shouldn't discard the character it finds.  So to use them, you either
have to use a String with an explicit index, or you have to modify the
stream code to allow you to access these methods.


Lex





More information about the Squeak-dev mailing list