[squeak-dev] The Inbox: ShoutCore-ct.71.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Sep 3 12:20:11 UTC 2019


A new version of ShoutCore was added to project The Inbox:
http://source.squeak.org/inbox/ShoutCore-ct.71.mcz

==================== Summary ====================

Name: ShoutCore-ct.71
Author: ct
Time: 3 September 2019, 2:20:09.991948 pm
UUID: 2635dce1-6bda-3a4d-a726-3f66bb7c6431
Ancestors: ShoutCore-ul.68

Use TimeStamps instead of deprecated #primUTCMicrosecondClock.

=============== Diff against ShoutCore-ul.68 ===============

Item was changed:
  ----- Method: SHParserST80 class>>benchmark (in category 'benchmarking') -----
  benchmark
  
  	| methods methodCount totalTime averageTime min median percentile80 percentile95 percentile99 max |
  	Smalltalk garbageCollect.
  	methods := OrderedCollection new: 100000.
  	CurrentReadOnlySourceFiles cacheDuring: [
  		| parser |
  		parser := SHParserST80 new.
  		SystemNavigation default allSelectorsAndMethodsDo: [ :class :selector :method |
  			| source start ranges |
  			source := method getSource asString.
+ 			start := TimeStamp now.
- 			start := Time primUTCMicrosecondClock.
  			ranges := parser
  				rangesIn: source
  				classOrMetaClass: class
  				workspace: nil
  				environment: nil.
+ 			methods addLast: { (TimeStamp now - start) asMicroSeconds. method. ranges size } ] ].
- 			methods addLast: { Time primUTCMicrosecondClock - start. method. ranges size } ] ].
  	methods sort: #first asSortFunction.
  	methodCount := methods size.
  	totalTime := methods detectSum: #first.
  	averageTime := (totalTime / methodCount) rounded.
  	
  	min := methods first.
  	median := methods at: methodCount // 2.
  	percentile80 := methods at: (methodCount * 0.8) floor.
  	percentile95 := methods at: (methodCount * 0.95) floor.
  	percentile99 := methods at: (methodCount * 0.99) floor.
  	max := methods last.
  	^'
  	Methods		{1}
  	Total			{2}ms
  	Average		{3}ms
  	Min				{4}ms {5} range(s) ({6})
  	Median			{7}ms {8} ranges ({9})
  	80th percentile	{10}ms {11} ranges ({12})
  	95th percentile	{13}ms {14} ranges ({15})
  	99th percentile	{16}ms {17} ranges ({18})
  	Max			{19}ms {20} ranges ({21})' format: ({
  		methodCount asString.
  		totalTime.
  		averageTime.
  		min first.
  		min third asString.
  		min second reference.
  		median first.
  		median third asString.
  		median second reference.
  		percentile80 first.
  		percentile80 third asString.
  		percentile80 second reference.
  		percentile95 first.
  		percentile95 third asString.
  		percentile95 second reference.
  		percentile99 first.
  		percentile99 third asString.
  		percentile99 second reference.
  		max first.
  		max third asString.
  		max second reference } replace: [ :each |
  			each isNumber 
  				ifTrue: [ (each / 1000) printShowingDecimalPlaces: 3 ]
  				ifFalse: [ each ] ])!



More information about the Squeak-dev mailing list