I created a little package for reading and writing object graphs with SIXX. The latest version of Sixx has some issues fixed regarding stream handling and encoding (strings are written platform independent in utf-8).

Based on that the utility tries to solve memory issues with bigger graphs. I incorporated a code snippet I got from Dale Henrichs some time ago that solves read issues. It installs memory threshold handling so that if temporary object memory gets low a commit is done to subsequent get a file of any size into the image. The same happens for the conversion from string to object via Sixx.

Writing of a graph is done using the streaming API of Sixx. The problem here is that nextPut: and nextPutAll: of file streams are pretty slow operations in gemstone. I added a buffering stream that lowers the amount of needed operations on the underlying gemstone file stream. The speedup is immense.

If you want to serialize a graph you can do it this way

GUGemStoneSixxUtil new 
	writeObject: Object new 
	toFile: 'sixx.xml' 
	inFolder: '/tmp'.

Reading it back you do with

GUGemStoneSixxUtil new 
	readObjectFromFileNamed: '/tmp/sixx.xml'

The buffer can be adjusted with

GUGemStoneSixxUtil new
	streamBufferSize: aNumber
	...

The default is 100000 which seems to be ok. The package you can get from

MCHttpRepository
	location: 'http://source.selfish.org/mc/misc'
	user: 'small'
	password: 'talk'

If there are any issues just drop me a note.

Posted by Norbert Hartl at 02/26/2011, 11:13 am with tags smalltalk, gemstone, sixx, xml link
|