<div dir="ltr">I think the improvement is obvious if you check how much code is run to do the Simpson's integration. BOX.BOX will literally be the filter used almost always once this is finally fixed.<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 22, 2015 at 12:08 PM, Oded Gabbay <span dir="ltr"><<a href="mailto:oded.gabbay@gmail.com" target="_blank">oded.gabbay@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Dec 22, 2015 at 9:44 PM, Bill Spitzak <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>> wrote:<br>
> Any test using Cairo is not using this code for scaling down (since it uses<br>
> it's own filter generator, or older Cairo which only used bilinear) so I am<br>
> not sure if this case is being hit. If GOOD in the future produces BOX.BOX<br>
> then this will be hit a lot more often.<br>
><br>
</span>OK, got it. Thanks.<br>
<br>
So do you have some other case where you can demonstrate the<br>
effectiveness of this optimization ?<br>
<br>
If not, then I think we need to defer this patch until such a case<br>
arises, e.g. what you wrote about GOOD producing BOX.BOX in the<br>
future.<br>
<span class="HOEnZb"><font color="#888888"><br>
Oded<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
><br>
> On Tue, Dec 22, 2015 at 1:33 AM, Oded Gabbay <<a href="mailto:oded.gabbay@gmail.com">oded.gabbay@gmail.com</a>> wrote:<br>
>><br>
>> On Sat, Dec 12, 2015 at 8:06 PM, <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>> wrote:<br>
>> > From: Bill Spitzak <<a href="mailto:spitzak@gmail.com">spitzak@gmail.com</a>><br>
>> ><br>
>> > This is easy as the caller already intersected the two boxes, so<br>
>> > the width is the integral.<br>
>> > ---<br>
>> > pixman/pixman-filter.c | 5 +++++<br>
>> > 1 file changed, 5 insertions(+)<br>
>> ><br>
>> > diff --git a/pixman/pixman-filter.c b/pixman/pixman-filter.c<br>
>> > index 4aafa51..782f73d 100644<br>
>> > --- a/pixman/pixman-filter.c<br>
>> > +++ b/pixman/pixman-filter.c<br>
>> > @@ -182,6 +182,11 @@ integral (pixman_kernel_t reconstruct, double x1,<br>
>> > assert (width == 0.0);<br>
>> > return filters[sample].func (x2 / scale);<br>
>> > }<br>
>> > + else if (reconstruct == PIXMAN_KERNEL_BOX && sample ==<br>
>> > PIXMAN_KERNEL_BOX)<br>
>> > + {<br>
>> > + assert (width <= 1.0);<br>
>> > + return width;<br>
>> > + }<br>
>> > else if (sample == PIXMAN_KERNEL_IMPULSE)<br>
>> > {<br>
>> > assert (width == 0.0);<br>
>> > --<br>
>> > 1.9.1<br>
>> ><br>
>> > _______________________________________________<br>
>> > Pixman mailing list<br>
>> > <a href="mailto:Pixman@lists.freedesktop.org">Pixman@lists.freedesktop.org</a><br>
>> > <a href="http://lists.freedesktop.org/mailman/listinfo/pixman" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/pixman</a><br>
>><br>
>><br>
>> As Soren said in his original email, this specialized case is<br>
>> justified if we can demonstrate an improvement in a real-world<br>
>> use-case, while making sure there aren't any other regressions.<br>
>><br>
>> Generally speaking, when adding specific conditions to optimize code<br>
>> we need to see evidence that indeed the new code is faster in *most*<br>
>> cases. This is because even if the added conditions improve<br>
>> performance of a specific use-case, it might actually degrade<br>
>> performance on most other cases as they now need to do additional<br>
>> comparisons in every pass of this code.<br>
>><br>
>> Therefore, I think we need to see some real numbers to accept this patch.<br>
>><br>
>> fyi, I did a cairo benchmark run (on the trimmed benchmarks), and it<br>
>> was practically unchanged. When I checked the results with<br>
>> "--min-change 1%", I got:<br>
>><br>
>> Speedups<br>
>> ========<br>
>> image t-firefox-canvas-swscroll 691.34 (701.92 1.30%) -> 678.93<br>
>> (693.67 1.25%): 1.02x speedup<br>
>><br>
>> image t-firefox-fishtank 1611.65 (1640.22 1.23%) -> 1591.66<br>
>> (1653.68 1.91%): 1.01x speedup<br>
>><br>
>> Slowdowns<br>
>> =========<br>
>> image t-gnome-system-monitor 886.06 (893.33 1.20%) -> 895.76<br>
>> (903.89 1.32%): 1.01x slowdown<br>
>><br>
>> image t-firefox-fishbowl 3242.06 (3280.91 0.55%) -> 3284.20<br>
>> (3285.17 0.08%): 1.01x slowdown<br>
>><br>
>> image t-evolution 335.63 (337.11 0.28%) -> 340.48<br>
>> (352.97 1.62%): 1.01x slowdown<br>
>><br>
>> image t-xfce4-terminal-a1 554.95 (572.35 1.59%) -> 563.67<br>
>> (582.91 1.62%): 1.02x slowdown<br>
>><br>
>> image t-gnome-terminal-vim 354.85 (358.67 0.67%) -> 364.49<br>
>> (366.12 0.33%): 1.03x slowdown<br>
>><br>
>> Oded<br>
><br>
><br>
</div></div></blockquote></div><br></div>