alan little’s weblog

xml races (4)

13th December 2005 permanent link

James Robertson is surprised that I timed VisualWorks Smalltalk’s XML parser at not much faster than python’s built in one, and finds he can parse a 13 MB xml file in 44.7 seconds on his Mac Mini, which has a little faster cpu but less memory than my Powerbook. Given that James knows what he is doing with Smalltalk, whereas I used to a little bit years ago and have only just started dabbling again, let's assume his code:

    content := 'feeds.xml' asFilename contentsOfEntireFile.
    parser := XMLParser new.
    parser validate: false.
    Time millisecondsToRun: [parser parse: content readStream]

… is more efficient than mine (although I did include opening and reading the file in all the other tests too):

    XML.XMLParser processDocumentInFilename: "filename" 
        beforeScanDo: :p | p validate: false.

… then that would put VisualWorks Smalltalk on a par with or a bit faster than the fastest pure python XML parser, but still an order of magnitude slower than python-augmented-with-C.

More.

related entries: Programming

all text and images © 2003–2008