<div>Thank you, good response!</div><div> </div><div>Anyway, I'm not specially aware about the speed in that section of the program. The really big work is done in other places. Also, addOc runs in lists of 300~400 as maximum (but only in special inputs, average is under 200), so the time difference can't be improved notoriously, and I won't see changes in performance.</div>
<div> </div><div>But I will follow your pointers when necessary in the future.<br></div><div class="gmail_quote">On Sun, Oct 23, 2011 at 7:50 PM, Daniel Fischer <span dir="ltr"><<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.com</a>></span> wrote:<br>
<blockquote style="margin: 0px 0px 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); border-left-width: 1px; border-left-style: solid;" class="gmail_quote"><div class="im">On Sunday 23 October 2011, 19:33:55, Daniel Díaz Casanueva wrote:<br>
> Hi, cafe!<br>
><br>
> I wrote a program and had the following message while compiling (with<br>
> -O2):<br>
><br>
> SpecConstr<br>
> Function `addOc{v s6RL} [lid]'<br>
> has four call patterns, but the limit is 3<br>
> Use -fspec-constr-count=n to set the bound<br>
> Use -dppr-debug to see specialisations<br>
><br>
> What it means? Is it bad? It only happens when compiling with -O2.<br>
<br>
</div>It's nothing serious.<br>
It's just a message (that accidentally was output by default in the 7.0.*<br>
series) that the spec-constr pass could have done more specialising, but<br>
the limit forbade it.<br>
<br>
More specialising on constructors means<br>
<br>
- certainly bigger code<br>
- potentially faster code<br>
<br>
but it could also become slower (most likely because of worse cache<br>
locality).<br>
<br>
It's not even a warning, just a notification.<br>
<div class="im"><br>
><br>
> addOc is a local function (defined in a where clause). If it helps, here<br>
> is the definition:<br>
><br>
> addOc x [] = [(x,1)]<br>
> addOc x ((y,n):ys) = if x == y then (y,n+1) : ys<br>
> else (y,n) : addOc x ys<br>
><br>
> I want to know if there is something wrong or a I don't need to take<br>
> care about this.<br>
<br>
</div>You need not take care of it, but you can try out and pass<br>
-fspec-constr-count=N<br>
on the command line (here, N = 4 is a good start) to see if the generated<br>
code is faster.<br>
<div><div></div><div class="h5"><br>
><br>
> Thanks in advance,<br>
> Daniel Díaz.<br>
<br>
</div></div></blockquote></div><br>