XML, Squeak, and speed

Richard A. O'Keefe ok at atlas.otago.ac.nz
Fri May 11 05:54:43 UTC 2001


Michael Rueger <m.rueger at acm.org> replied to my posting.
	> As a test case, I took the 'shakespeare.xml' file that comes with the
	> XMill compressor.  It's actually Antony and Cleopatra.
	Is it around 260k?
	
Yes.
	Did you try my YAX parser?
	it took 11 sec to parse and tree build on a 500 KIII.
	
No, I haven't tried YAX, although I am aware of it.
The issue is not "how fast can it be done?" but "how cleanly and fast can
*I*" do it, and what can I learn while I try?"

I'm not quite sure how fast my machine is.  'fpversion' is reporting
anything between 84MHz and 128MHz depending on when I run it.  I thought
it was supposed to be faster than that, but it's only an Ultra 1 in a
SS5 case.  Assume it's 125MHZ, and that speed scales with clock speed,
and that the 500 in "500 KIII" is clock speed, then my parser *ought* to
take about 5 seconds on a 500 KIII.  Don't take that too seriously.

	| stream result |
	stream _ ReadStream on: (FileDirectory default readOnlyFileNamed:
	'a_and_c.xml') contentsOfEntireFile.
	Transcript show: [result _ XMLDOMParser parseDocumentFrom: stream]
	timeToRun printString; cr.
	stream close.
	result
	
	To achieve your goal do(with the extra file-in "desc.cs" to yax):
	result descendants:  'SPEAKER') collect:  [:each | each key ->
	each value contentString]
	
Well no, my example sorted and grouped them as well, but point taken.
By the way, I use symbols for entity names, element types, and attribute
names because I've explored lots of different representations in C, and
having unique strings for these things saves *lots* of space.

My 'text' operation corresponds to the DOM 'text' operation,
not the 'value' operation.
	
	I'm attaching a change set Bolot sent me a while ago to look at XML
	files in scamper.
	
Ta muchly.

No slight of YAX is intended.  Sometimes you learn more by rolling your own.
Oxus is no rival of YAX.





More information about the Squeak-dev mailing list