[squeak][pws] Win32 Server Sockets

John (Zhijiang) Han zhan1 at uiuc.edu
Wed Nov 11 22:49:01 UTC 1998


[I cross-post this to both [squeak] and [pws] as what I'm talking about is
not limited to PWS]

As proposed in one of my previous messages, I'm gonna to port the ACE
framework (http://www.cs.wustl.edu/~schmidt/ACE.html) to Smalltalk/Squeak,
and implement some servers (e.g. Mail Server/POP/Mailing List Archive). 

It turns out that the most essential thing to have high performance server
is to have a Cached Virtual File System.  Here is the result of a
priliminary performance analysis I did on the current PWS system (not
really, but the one's been refactored by me recently, see
http://brain.cs.uiuc.edu:8080/cs497rej.203) using MessageTally, with Tally
Tree trimmed for simplicity (The analysis method attached below),

(('ourownarea' '219' ) ) - 75 tallies.

28.0 UnixFileDirectory(FileDirectory)>>directoryContentsFor:
26.7 String(SequenceableCollection)>>copyReplaceFrom:to:with:
10.7 Symbol class>>intern:
9.3 String(SequenceableCollection)>>copyFrom:to:
6.7 WriteStream>>nextPutAll:
5.3 String(SequenceableCollection)>>replaceFrom:to:with:

(('ourownarea' '219' 'edit' ) ) - 629 tallies.

53.4 StandardFileStream(PositionableStream)>>nextDelimited:
23.7 StandardFileStream>>next
4.9 String(SequenceableCollection)>>copyReplaceFrom:to:with:
3.0 String(SequenceableCollection)>>copyFrom:to:

(('ourownarea' '219' 'input' ) ) - 1792 tallies.

15.1 String>>withSqueakLineEndings
13.7 SwikiPage>>uniqueInsertionPoints:
9.3 HTMLformatter class>>rangesOfAngleBrackets:
8.8 String>>storeOn:
8.3 Interval>>includes:
7.4 StandardFileStream>>close
6.3 String(SequenceableCollection)>>indexOfSubCollecti...rtingAt:ifAbsent:
5.9 SwikiPage>>swikify:withOptions:
3.5 OrderedCollection>>do:
2.4 OrderedCollection(Collection)>>detect:ifNone:

(('ourownarea' '219' 'all' ) ('ourownarea' '219' 'references' )
('ourownarea' '219' ) ) - 28 tallies.

28.6 UnixFileDirectory(FileDirectory)>>directoryContentsFor:
21.4 String(SequenceableCollection)>>copyReplaceFrom:to:with:
21.4 Symbol class>>intern:
7.1 MethodContext(ContextPart)>>pop:toIndexable:

I'm wondering whether some related work has already been done.  Here is
the method I'm using to produce the numbers.  

'From Squeak 2.2 of Sept 23, 1998 on 11 November 1998 at 4:25:51 pm'!

!PWS methodsFor: 'Processing' stamp: 'JZH 11/11/1998 16:16'!
spyEvery: millisecs onKey: key andIndices: indices 
	| action result timesToRepeat node page |
	(log _ Dictionary new) at: #noLog put: true;
	 at: #bytes put: 0;
	 at: #date put: PWS date;
	 at: #authuser put: userId;
	 at: #rfc931 put: userId;
	 at: #remotehost put: (peerName _ 'localhost').
	(fields _ Dictionary new) at: 'searchFor' put: 'nothing'.
	action _ ActionTable at: key.
	timesToRepeat _ (20 / indices size) asInteger.
	node _ MessageTally new.
	result _ WriteStream on: ''.
	{{{key. '1'} }. 
	{{key. '2'. 'edit'} }. 
	{{key. '3'. 'input'} }. 
	{{key. '4'. 'all'}. {key. '5'. 'references'}. {key.
'searchresult'} } } do: 
		[:group | group do: [:each | message _ each. indices do:
[:index | 
				url _ key , (message at: 2 put: index
asString).
				page _ action pageAtID: index.
				fields at: 'text' put: page text.
				node spyEvery: millisecs on:
[timesToRepeat timesRepeat: [action process: self]].
				(message at: 3 ifAbsent: [])
					= 'input' ifTrue: [page
condenseChanges]]].
		result cr; nextPutAll: group asString.
		node report: result; close].
	(StringHolder new contents: result contents) openLabel: 'Spy
Results'! !


Cheers
John (Zhijiang)





More information about the Squeak-dev mailing list