<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Jul 23, 2017 at 6:26 PM, Artem <span dir="ltr"><<a href="mailto:p0nk@ya.ru" target="_blank">p0nk@ya.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><pre style="margin:0px 0px 1em;padding:5px;border:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:inherit;font-weight:normal;font-stretch:inherit;font-size:13px;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;width:auto;max-height:600px;overflow:auto;background-color:rgb(239,240,241);display:block;color:rgb(57,51,24);text-align:left;text-transform:none"><code style="background-color:#eff0f1;border:0px;font-family:consolas,menlo,monaco,lucida console,liberation mono,dejavu sans mono,bitstream vera sans mono,courier new,monospace,sans-serif;font-size:13px;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"><br>sumArr </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">=</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> scan </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">(\</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">acc x </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">-></span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> </span><span style="border:0px;color:#101094;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">let</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">!</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">newAcc </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">=</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> acc </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">+</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> x </span><span style="border:0px;color:#101094;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">in</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> newAcc</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">)</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> </span><span style="border:0px;color:#7d2727;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">0</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">
sumArr' </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">=</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> proc v </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">-></span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> </span><span style="border:0px;color:#101094;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">do</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> sumArr </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">-<</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> v

testData </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">::</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">[</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">Int</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">]</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">
testData </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">=</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">[</span><span style="border:0px;color:#7d2727;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">1</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">..</span><span style="border:0px;color:#7d2727;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">1000000</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">]</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">

main </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">=</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> print </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">$</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> L.last </span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline">$</span><span style="border:0px;color:#303336;font-family:inherit;font-size:inherit;font-stretch:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;line-height:inherit;margin:0px;padding:0px;vertical-align:baseline"> evalList sumArr' testData</span></code></pre><div>Running time for main with sumArr (i.e. no proc notation) is 0.087 sec, while for sumArr' it is 3.2 seconds (and around 300mb memory usage), although sumArr' is just sumArr called within a proc block.</div></div></blockquote><div><br></div><div>Absent other information (like the core from each) I would be tempted to think that the problem is some stream fusion RULES either did not fire or degraded into a pessimization.</div></div><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</div></div>