<div dir="auto">agree. </div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 12, 2019, 20:51 David T. Lewis <<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Meanwhile, +1 for moving Marcel's Chronology changes to trunk :-)<br>
<br>
Dave<br>
<br>
On Tue, Nov 12, 2019 at 05:25:46PM -0600, Chris Muller wrote:<br>
> (Palm meets forehead.  :)  )<br>
> <br>
> Still, not obvious what would be a good name.  #asMetricDescription?<br>
>  #printSiUnits?<br>
> <br>
> And, actually, a more general function would seem to beg for more<br>
> configurability -- like full-name vs. abbreviation, as well the possibility<br>
> of specifying a precision.<br>
> <br>
> I'll have to think about it, thanks...<br>
> <br>
> <br>
> <br>
> On Tue, Nov 12, 2019 at 3:04 AM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de" target="_blank" rel="noreferrer">marcel.taeumel@hpi.de</a>><br>
> wrote:<br>
> <br>
> > Heyho.<br>
> ><br>
> > > ... but I think extends even beyond "bytes descriptions" ...<br>
> ><br>
> > +1 The "bytes" domain is way too specific for this kind of functionality<br>
> ><br>
> > <a href="https://en.wikipedia.org/wiki/Metric_prefix" rel="noreferrer noreferrer" target="_blank">https://en.wikipedia.org/wiki/Metric_prefix</a><br>
> ><br>
> > Best,<br>
> > Marcel<br>
> ><br>
> > Am 12.11.2019 04:42:05 schrieb Chris Muller <<a href="mailto:asqueaker@gmail.com" target="_blank" rel="noreferrer">asqueaker@gmail.com</a>>:<br>
> > Hi guys,<br>
> ><br>
> > This looks like a lot of thought went into making an output that we want<br>
> > to be both functional as well as easy to read.<br>
> ><br>
> > On a similar topic, has anyone else been finding #asBytesDescription to be<br>
> > similarly useful for reporting integral quantities, when the top three<br>
> > orders of precision are enough?  What I like about it is how it lets me<br>
> > express any integer all the way up to (2 raisedTo: 99) in no more than<br>
> > *four* characters.  See?<br>
> ><br>
> >    9999 asBytesDescription     "10k"<br>
> >    (2 raisedTo: 99) asBytesDescription     "  '634Y'  <--- Yotta's"<br>
> ><br>
> > This is a wonderfully dense representation, but I think extends even<br>
> > beyond "bytes descriptions" -- I think we need a better name for it...  Is<br>
> > there a proper academic name for this representation?<br>
> ><br>
> >  - Chris<br>
> ><br>
> ><br>
> > On Mon, Nov 11, 2019 at 4:40 AM <<a href="mailto:commits@source.squeak.org" target="_blank" rel="noreferrer">commits@source.squeak.org</a>> wrote:<br>
> ><br>
> >> A new version of Chronology-Core was added to project The Inbox:<br>
> >> <a href="http://source.squeak.org/inbox/Chronology-Core-mt.51.mcz" rel="noreferrer noreferrer" target="_blank">http://source.squeak.org/inbox/Chronology-Core-mt.51.mcz</a><br>
> >><br>
> >> ==================== Summary ====================<br>
> >><br>
> >> Name: Chronology-Core-mt.51<br>
> >> Author: mt<br>
> >> Time: 11 November 2019, 11:40:16.217633 am<br>
> >> UUID: 199ad2ea-67cb-2545-84e9-4f24e577216f<br>
> >> Ancestors: Chronology-Core-mt.50<br>
> >><br>
> >> Improve formatting for GC pressure as suggested by Dave.<br>
> >><br>
> >> =============== Diff against Chronology-Core-mt.50 ===============<br>
> >><br>
> >> Item was changed:<br>
> >>   ----- Method: BlockClosure>>benchFor: (in category '*chronology-core')<br>
> >> -----<br>
> >>   benchFor: aDuration<br>
> >>         "See how many times I can value within the given duration.  I'll<br>
> >> answer a meaningful description."<br>
> >><br>
> >>         | startTime shouldRun count elapsedTime roundTo3Digits delay<br>
> >> gcStart gcTime |<br>
> >>         roundTo3Digits := [:num |<br>
> >>                 | rounded lowDigit |<br>
> >>                 rounded := (num * 1000) rounded. "round to 1/1000"<br>
> >>                 lowDigit := (rounded numberOfDigitsInBase: 10) - 3. "keep<br>
> >> only first 3 digits"<br>
> >>                 rounded := rounded roundTo:(10 raisedTo: lowDigit).<br>
> >>                 (lowDigit >= 3 or: [rounded \\ 1000 = 0]) "display<br>
> >> 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<br>
> >> timingPriority - 1.<br>
> >>         startTime := Time millisecondClockValue.<br>
> >>         gcStart := (Smalltalk vmParameterAt: 8) + (Smalltalk<br>
> >> vmParameterAt: 10).<br>
> >>         [ shouldRun ] whileTrue: [<br>
> >>                 self value.<br>
> >>                 count := count + 1 ].<br>
> >>         elapsedTime := Time millisecondsSince: startTime.<br>
> >>         gcTime := (Smalltalk vmParameterAt: 8) + (Smalltalk<br>
> >> vmParameterAt: 10) - gcStart.<br>
> >>         ^(roundTo3Digits value: count * 1000 / elapsedTime) , ' per<br>
> >> second.', ((<br>
> >>                 #(<br>
> >>                         (1e-3 'seconds')<br>
> >>                         (1 'milliseconds')<br>
> >>                         (1e3 'microseconds')<br>
> >>                         (1e6 'nanoseconds')<br>
> >>                 )<br>
> >>                         detect: [ :pair | elapsedTime * pair first >=<br>
> >> count ]<br>
> >>                         ifNone: [ #(1e9 'picoseconds') ])<br>
> >>                 in: [ :pair |<br>
> >>                         ' {1} {2} per run.' format: {<br>
> >>                                 (roundTo3Digits value: elapsedTime * pair<br>
> >> first / count).<br>
> >> +                               pair second } ]), (' {1} % GC time.'<br>
> >> format: {gcTime / elapsedTime * 100 printShowingMaxDecimalPlaces: 5})!<br>
> >> -                               pair second } ]), (' {1} % GC time.'<br>
> >> format: {gcTime / elapsedTime * 100 roundTo: 0.0001})!<br>
> >><br>
> >><br>
> >><br>
<br>
> <br>
<br>
<br>
</blockquote></div>