Profiling help needed

Raab, Andreas Andreas.Raab at disney.com
Fri Feb 2 08:23:47 UTC 2001


Folks,

I need some help with finding out how fast (?!) certain operations (namely
signing and verifying of Squeaklets) are on slower machines. May daily
machine is a 700MHz P3 and this doesn't quite count for an average user :-)
So I need some help from people actually running the latest stuff on older
machines. If you have a 2.9 running, then please run the code below and send
me those numbers back. Please include processor, speed and platform;
something like

700MHz P3 Win32: #(8296 352 362)

would be perfect. Be warned, this stuff *may*take*a*little*while* :-)

Thanks a lot! You're doing this for the benefit of mankind :-)

  - Andreas

Here it goes:

| dsa keySet msg init time1 sc msgStream time2 hash sig time3 okay |
"initialize DSA"
dsa _ DigitalSignatureAlgorithm new.
init _ (Time millisecondClockValue printString, 
		Date today printString, 
		Smalltalk platformName printString) asByteArray.
init _ (LargePositiveInteger basicNew: init size) 
		replaceFrom: 1 to: init size with: init startingAt: 1.
dsa initRandom: init.

"generate us a key pair"
time1 _ [keySet _ dsa generateKeySet] timeToRun.

"create us a nice large message (approx. 1MB)"
msg _ String streamContents:[:s|
	sc _ InterpreterSupportCode class 
		sourceCodeAt: #macNetworkFile.
	1 to: (1000000 // sc size) do:[:i|
		s nextPutAll: sc.
	]].
msg _ msg asByteArray.
msgStream _ ReadStream on: msg.

"now compute hash and sign it"
time2 _ [hash _ SecureHashAlgorithm new hashStream: msgStream.
		sig _ dsa computeSignatureForMessageHash: hash 
				privateKey: keySet first
		] timeToRun.

"now verify it"
msgStream reset.
time3 _ [hash _ SecureHashAlgorithm new hashStream: msgStream.
		okay _ dsa verifySignature: sig 
				ofMessageHash: hash 
				publicKey: keySet last
		] timeToRun.
okay ifFalse:[self error:'verification failed???'].

"and the results"
^{time1. time2. time3 }





More information about the Squeak-dev mailing list