[squeak-dev] The Trunk: Nebraska-nice.36.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Dec 25 22:21:06 UTC 2013


Nicolas Cellier uploaded a new version of Nebraska to project The Trunk:
http://source.squeak.org/trunk/Nebraska-nice.36.mcz

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

Name: Nebraska-nice.36
Author: nice
Time: 25 December 2013, 11:20:43.521 pm
UUID: cc80dca4-ed72-4c39-952c-3b37886100de
Ancestors: Nebraska-ul.35

Change a few print:(aFloat roundTo: 0.01) into nextPutAll:(aFloat printShowingMaxDecimalPlaces: 2)

=============== Diff against Nebraska-ul.35 ===============

Item was changed:
  ----- Method: CanvasEncoder class>>explainTestVars (in category 'as yet unclassified') -----
  explainTestVars
  "
  CanvasEncoder explainTestVars
  "
  	| answer oneBillion total |
  
  	SimpleCounters ifNil: [^ Beeper beep].
  	total := 0.
  	oneBillion := 1000 * 1000 * 1000.
  	answer := String streamContents: [ :strm | | data putter |
  		data := SimpleCounters copy.
  		putter := [ :msg :index :nSec | | nReps |
  			nReps := data at: index.
  			total := total + (nSec * nReps).
  			strm nextPutAll: nReps asStringWithCommas,' * ',nSec printString,' ',
+ 					(nSec * nReps / oneBillion printShowingMaxDecimalPlaces: 2),' secs for ',msg; cr
- 					(nSec * nReps / oneBillion roundTo: 0.01) printString,' secs for ',msg; cr
  		].
  		putter value: 'string socket' value: 1 value: 8000.
  		putter value: 'rectangles' value: 2 value: 40000.
  		putter value: 'points' value: 3 value: 18000.
  		putter value: 'colors' value: 4 value: 8000.
  	].
  	StringHolder new
  		contents: answer;
  		openLabel: 'put integer times'.
  
  !

Item was changed:
  ----- Method: CanvasEncoder class>>timeSomeThings (in category 'as yet unclassified') -----
  timeSomeThings
  "
  CanvasEncoder timeSomeThings
  "
  	| answer array color iter |
  
  	iter := 1000000.
  	array := Array new: 4.
  	color := Color red.
  	answer := String streamContents: [ :strm | | bm rect writer pt s |
  		writer := [ :msg :doer | | ms |
  			ms := [iter timesRepeat: doer] timeToRun.
+ 			strm nextPutAll: msg,((ms * 1000 / iter) printShowingMaxDecimalPlaces: 2),' usec'; cr.
- 			strm nextPutAll: msg,((ms * 1000 / iter) roundTo: 0.01) printString,' usec'; cr.
  		].
  		s := String new: 4.
  		bm := Bitmap new: 20.
  		pt := 100 at 300.
  		rect := pt extent: pt.
  	iter := 1000000.
  		writer value: 'empty loop ' value: [self].
  		writer value: 'modulo ' value: [12345678 \\ 256].
  		writer value: 'bitAnd: ' value: [12345678 bitAnd: 255].
  		strm cr.
  	iter := 100000.
  		writer value: 'putInteger ' value: [s putInteger32: 12345678 at: 1].
  		writer value: 'bitmap put ' value: [bm at: 1 put: 12345678].
  		writer value: 'encodeBytesOf: (big) ' value: [bm encodeInt: 12345678 in: bm at: 1].
  		writer value: 'encodeBytesOf: (small) ' value: [bm encodeInt: 5000 in: bm at: 1].
  		writer value: 'array at: (in) ' value: [array at: 1].
  		writer value: 'array at: (out) ' value: [array at: 6 ifAbsent: []].
  		strm cr.
  	iter := 10000.
  		writer value: 'color encode ' value: [color encodeForRemoteCanvas].
  		writer value: 'pt encode ' value: [pt encodeForRemoteCanvas].
  		writer value: 'rect encode ' value: [self encodeRectangle: rect].
  		writer value: 'rect encode2 ' value: [rect encodeForRemoteCanvas].
  		writer value: 'rect encodeb ' value: [rect encodeForRemoteCanvasB].
  	].
  
  	StringHolder new contents: answer; openLabel: 'send/receive stats'.
  !



More information about the Squeak-dev mailing list