<div dir="ltr">Hi Levente,<br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 14, 2018 at 12:35 AM Levente Uzonyi <<a href="mailto:leves@caesar.elte.hu">leves@caesar.elte.hu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, 13 Sep 2018, <a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a> wrote:<br>
<br>
> Nicolas Cellier uploaded a new version of Collections to project The Inbox:<br>
> <a href="http://source.squeak.org/inbox/Collections-nice.807.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/inbox/Collections-nice.807.mcz</a><br>
><br>
> ==================== Summary ====================<br>
><br>
> Name: Collections-nice.807<br>
> Author: nice<br>
> Time: 13 September 2018, 9:29:57.057799 pm<br>
> UUID: f4686e6e-1820-4c3f-841d-c1904914c147<br>
> Ancestors: Collections-topa.806<br>
><br>
> Let isSeparator be consistent with Character separators after introduction of nbsp. <br>
><br>
> The performance cost should be marginal.<br>
><br>
> Note: some (CharacterSet cleanUp: false) might be necessary in postscript, unless this is included in the release process...<br>
><br>
> =============== Diff against Collections-topa.806 ===============<br>
><br>
> Item was changed:<br>
>  ----- Method: Character>>isSeparator (in category 'testing') -----<br>
>  isSeparator<br>
>       "Answer whether the receiver is one of the separator characters--space, <br>
> +     cr, tab, line feed, or form feed and nbsp."<br>
> -     cr, tab, line feed, or form feed."<br>
><br>
>       | integerValue |<br>
> +     (integerValue := self asInteger) > 32 ifTrue: [ ^integerValue = 160 "non breaking space" ].<br>
<br>
Unfortunately the current JIT will not optimize that construct the same <br>
way as the ones used in the current implementation, so it'd still be <br>
~1-1.5x slower to use this compared to the "compare with constant and do <br>
a quick return" formula. If we really want to push this change, I'd rather <br>
try something like this:<br>
<br>
        (integerValue := self asInteger) > 32 ifTrue: [<br>
                integerValue = 160 ifTrue: [ ^true ].<br>
                ^false ].<br></blockquote><div><br></div><div>I'd rather you provide a test case and encourager me to fix the JIT to produce faster code.  It seems absurd to have to write such crappy code, and maybe the JIT will be easy to fix.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Levente<br>
<br>
> -     (integerValue := self asInteger) > 32 ifTrue: [ ^false ].<br>
>       integerValue<br>
>               caseOf: {<br>
>                       [ 32 "space" ] -> [ ^true ].<br>
>                       [ 9 "tab" ] -> [ ^true ].<br>
>                       [ 13 "cr"] -> [ ^true ].<br>
>                       [ 10 "line feed" ] -> [ ^true ].<br>
>                       [ 12 "form feed"] -> [ ^true ] }<br>
>               otherwise: [ ^false  ]!<br>
<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div>