<div dir="ltr">(Palm meets forehead.  :)  )<div><br></div><div>Still, not obvious what would be a good name.  #asMetricDescription?   #printSiUnits?</div><div><div><br></div><div>And, actually, a more general function would seem to beg for more configurability -- like full-name vs. abbreviation, as well the possibility of specifying a precision.</div><div><br></div><div>I'll have to think about it, thanks...</div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 12, 2019 at 3:04 AM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de" target="_blank">marcel.taeumel@hpi.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div id="gmail-m_-8751403142282287494gmail-m_-4959508541978136209__MailbirdStyleContent" style="font-size:10pt;font-family:Arial;color:rgb(0,0,0)">
                                        Heyho.<div><br></div><div>> ... <span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">but I think extends even beyond "bytes descriptions" ...</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">+1 The "bytes" domain is way too specific for this kind of functionality</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-size:10pt;font-family:Arial,Helvetica,sans-serif"><a href="https://en.wikipedia.org/wiki/Metric_prefix" target="_blank">https://en.wikipedia.org/wiki/Metric_prefix</a></span><br></div><div><br></div><div>Best,</div><div>Marcel</div><div></div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-top:20px;margin-left:0px;padding-left:10px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 12.11.2019 04:42:05 schrieb Chris Muller <<a href="mailto:asqueaker@gmail.com" target="_blank">asqueaker@gmail.com</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div dir="ltr">Hi guys, <div><br></div><div>This looks like a lot of thought went into making an output that we want to be both functional as well as easy to read.<br><div><br></div><div>On a similar topic, has anyone else been finding #asBytesDescription to be similarly useful for reporting integral quantities, when the top three orders of precision are enough?  What I like about it is how it lets me express any integer all the way up to (2 raisedTo: 99) in no more than *four* characters.  See?</div><div><br></div><div>   9999 asBytesDescription     "10k"</div><div>   (2 raisedTo: 99) asBytesDescription     "  '634Y'  <--- Yotta's"    <br></div><div><br></div><div>This is a wonderfully dense representation, but I think extends even beyond "bytes descriptions" -- I think we need a better name for it...  Is there a proper academic name for this representation?</div><div><br></div><div> - Chris</div><div></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Nov 11, 2019 at 4:40 AM <<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">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" 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>
  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>
        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 printShowingMaxDecimalPlaces: 5})!<br>
-                               pair second } ]), (' {1} % GC time.' format: {gcTime / elapsedTime * 100 roundTo: 0.0001})!<br>
<br>
<br>
</blockquote></div>
</div></blockquote>
                                        </div></div></blockquote></div>