<div dir="ltr"><div class="gmail_extra">Any test using Cairo is not using this code for scaling down (since it uses it's own filter generator, or older Cairo which only used bilinear) so I am not sure if this case is being hit. If GOOD in the future produces BOX.BOX then this will be hit a lot more often.<br><br><br><div class="gmail_quote">On Tue, Dec 22, 2015 at 1:33 AM, 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"><div class="HOEnZb"><div class="h5">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 == 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>
</div></div>> _______________________________________________<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>
<span class="HOEnZb"><font color="#888888"><br>
Oded<br>
</font></span></blockquote></div><br></div></div>