<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
<div>[Error] bench</div><div> '217,000,000 per second. 4.62 nanoseconds per run. 0.16 % GC time.'</div><div>[Error, Halt] bench</div><div> '10,400,000 per second. 96.5 nanoseconds per run. 6.2 % GC time.'</div><div>[Error, Halt, Warning] bench</div><div> '9,800,000 per second. 102 nanoseconds per run. 7.78 % GC time.'</div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 30.10.2019 10:25:21 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">A new version of Chronology-Core was added to project The Inbox:<br>http://source.squeak.org/inbox/Chronology-Core-mt.50.mcz<br><br>==================== Summary ====================<br><br>Name: Chronology-Core-mt.50<br>Author: mt<br>Time: 30 October 2019, 10:25:14.294226 am<br>UUID: f064aadc-0e62-174e-b97c-f70cc22a23f6<br>Ancestors: Chronology-Core-mt.49<br><br>Proposal to add GC pressure to #bench method.<br><br>=============== Diff against Chronology-Core-mt.49 ===============<br><br>Item was changed:<br> ----- Method: BlockClosure>>benchFor: (in category '*chronology-core') -----<br> benchFor: aDuration<br> "See how many times I can value within the given duration. I'll answer a meaningful description."<br> <br>+ | startTime shouldRun count elapsedTime roundTo3Digits delay gcStart gcTime |<br>- | startTime shouldRun count elapsedTime roundTo3Digits delay |<br> roundTo3Digits := [:num |<br> | rounded lowDigit |<br> rounded := (num * 1000) rounded. "round to 1/1000"<br> lowDigit := (rounded numberOfDigitsInBase: 10) - 3. "keep only first 3 digits"<br> rounded := rounded roundTo:(10 raisedTo: lowDigit).<br> (lowDigit >= 3 or: [rounded \\ 1000 = 0]) "display fractional part only when needed"<br> ifTrue: [(rounded // 1000) asStringWithCommas]<br> ifFalse: [(rounded / 1000.0) printString]].<br> delay := aDuration asDelay.<br> count := 0.<br> shouldRun := true.<br>+ Smalltalk garbageCollect.<br> [ delay wait. shouldRun := false ] forkAt: Processor timingPriority - 1.<br> startTime := Time millisecondClockValue.<br>+ gcStart := (Smalltalk vmParameterAt: 8) + (Smalltalk vmParameterAt: 10).<br> [ shouldRun ] whileTrue: [ <br> self value.<br> count := count + 1 ].<br> elapsedTime := Time millisecondsSince: startTime.<br>+ gcTime := (Smalltalk vmParameterAt: 8) + (Smalltalk vmParameterAt: 10) - gcStart.<br> ^(roundTo3Digits value: count * 1000 / elapsedTime) , ' per second.', ((<br> #(<br> (1e-3 'seconds')<br> (1 'milliseconds')<br> (1e3 'microseconds')<br> (1e6 'nanoseconds')<br> )<br> detect: [ :pair | elapsedTime * pair first >= count ]<br> ifNone: [ #(1e9 'picoseconds') ])<br> in: [ :pair |<br> ' {1} {2} per run.' format: {<br> (roundTo3Digits value: elapsedTime * pair first / count).<br>+ pair second } ]), (' {1} % GC time.' format: {gcTime / elapsedTime * 100 roundTo: 0.0001})!<br>- pair second } ])!<br><br><br></div></blockquote></div>