<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p><span style="font-size: 12pt;">Hi Levente,</span><br>
</p>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p><br>
</p>
<p>thanks for the hint. I see #<span>primUTCMicrosecondClock is more efficient, but do we really want to risk a clock wrap here (integer overflow)?</span></p>
<p><span><br>
</span></p>
<p><span>Best,</span></p>
<p><span>Christoph</span></p>
<p><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>Von:</b> Squeak-dev <squeak-dev-bounces@lists.squeakfoundation.org> im Auftrag von Levente Uzonyi <leves@caesar.elte.hu><br>
<b>Gesendet:</b> Mittwoch, 4. September 2019 18:55:59<br>
<b>An:</b> squeak-dev@lists.squeakfoundation.org<br>
<b>Betreff:</b> Re: [squeak-dev] The Inbox: ShoutCore-ct.71.mcz</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt">
<div class="PlainText">Hi Christoph,<br>
<br>
On Tue, 3 Sep 2019, commits@source.squeak.org wrote:<br>
<br>
> A new version of ShoutCore was added to project The Inbox:<br>
> <a href="http://source.squeak.org/inbox/ShoutCore-ct.71.mcz" id="LPlnk893869" previewremoved="true">
http://source.squeak.org/inbox/ShoutCore-ct.71.mcz</a><br>
><br>
> ==================== Summary ====================<br>
><br>
> Name: ShoutCore-ct.71<br>
> Author: ct<br>
> Time: 3 September 2019, 2:20:09.991948 pm<br>
> UUID: 2635dce1-6bda-3a4d-a726-3f66bb7c6431<br>
> Ancestors: ShoutCore-ul.68<br>
><br>
> Use TimeStamps instead of deprecated #primUTCMicrosecondClock.<br>
<br>
In my understanding, TimeStamp is something we have been keeping around, <br>
because it's used for printing method timestamps, but for any other <br>
purpose there's its superclass: DateAndTime.<br>
With some effort, I think we could and should deprecate TimeStamp.<br>
<br>
#primUTCMicrosecondClock is still very useful, even though DateAndTime <br>
instances are not initialized with it anymore.<br>
For example, this primitive has the smallest overhead[1] to measure <br>
runtime with microsecond resolution, which is exactly what the method <br>
SHParserST80 class >> #benchmark uses it for.<br>
<br>
I mentioned it in an earlier mail that I intend to undeprecate it, and add <br>
the missing primitive 243 as well, which can be used to tell the VM to <br>
flush its time zone offset cache.<br>
<br>
Levente<br>
<br>
[1] It's a numbered primitive with no arguments returning an Integer. On <br>
64-bits, that integer will stay a SmallInteger for quite a while, so <br>
there's no overhead on the image side to invoke it.<br>
<br>
><br>
> =============== Diff against ShoutCore-ul.68 ===============<br>
><br>
> Item was changed:<br>
>  ----- Method: SHParserST80 class>>benchmark (in category 'benchmarking') -----<br>
>  benchmark<br>
><br>
>        | methods methodCount totalTime averageTime min median percentile80 percentile95 percentile99 max |<br>
>        Smalltalk garbageCollect.<br>
>        methods := OrderedCollection new: 100000.<br>
>        CurrentReadOnlySourceFiles cacheDuring: [<br>
>                | parser |<br>
>                parser := SHParserST80 new.<br>
>                SystemNavigation default allSelectorsAndMethodsDo: [ :class :selector :method |<br>
>                        | source start ranges |<br>
>                        source := method getSource asString.<br>
> +                      start := TimeStamp now.<br>
> -                      start := Time primUTCMicrosecondClock.<br>
>                        ranges := parser<br>
>                                rangesIn: source<br>
>                                classOrMetaClass: class<br>
>                                workspace: nil<br>
>                                environment: nil.<br>
> +                      methods addLast: { (TimeStamp now - start) asMicroSeconds. method. ranges size } ] ].<br>
> -                      methods addLast: { Time primUTCMicrosecondClock - start. method. ranges size } ] ].<br>
>        methods sort: #first asSortFunction.<br>
>        methodCount := methods size.<br>
>        totalTime := methods detectSum: #first.<br>
>        averageTime := (totalTime / methodCount) rounded.<br>
><br>
>        min := methods first.<br>
>        median := methods at: methodCount // 2.<br>
>        percentile80 := methods at: (methodCount * 0.8) floor.<br>
>        percentile95 := methods at: (methodCount * 0.95) floor.<br>
>        percentile99 := methods at: (methodCount * 0.99) floor.<br>
>        max := methods last.<br>
>        ^'<br>
>        Methods         {1}<br>
>        Total                   {2}ms<br>
>        Average         {3}ms<br>
>        Min                             {4}ms {5} range(s) ({6})<br>
>        Median                  {7}ms {8} ranges ({9})<br>
>        80th percentile {10}ms {11} ranges ({12})<br>
>        95th percentile {13}ms {14} ranges ({15})<br>
>        99th percentile {16}ms {17} ranges ({18})<br>
>        Max                     {19}ms {20} ranges ({21})' format: ({<br>
>                methodCount asString.<br>
>                totalTime.<br>
>                averageTime.<br>
>                min first.<br>
>                min third asString.<br>
>                min second reference.<br>
>                median first.<br>
>                median third asString.<br>
>                median second reference.<br>
>                percentile80 first.<br>
>                percentile80 third asString.<br>
>                percentile80 second reference.<br>
>                percentile95 first.<br>
>                percentile95 third asString.<br>
>                percentile95 second reference.<br>
>                percentile99 first.<br>
>                percentile99 third asString.<br>
>                percentile99 second reference.<br>
>                max first.<br>
>                max third asString.<br>
>                max second reference } replace: [ :each |<br>
>                        each isNumber<br>
>                                ifTrue: [ (each / 1000) printShowingDecimalPlaces: 3 ]<br>
>                                ifFalse: [ each ] ])!<br>
<br>
</div>
</span></font></div>
</body>
</html>