Commit Graph

6 Commits

Author SHA1 Message Date
Frediano Ziglio
1804b8bb85 improve performances comparing image pixels
This patch contains a bit of small optimizations.
It avoid boolean	 operations which could involve branches replacing
with binary operations (equal/all_ident -> some_differences).
The other optimization avoids the use of ABS. First the way the macro
was used (with a large expression) was not easy to optimize by the
compiler.
Then instead of using ABS a much simpler range check is used so instead
of (ABS(n) >= k) a ((n) <= -k || (n) >= k) is used. This looks small
but modern compilers can translate this not in range check in a couple
of machine instructions (and a single compare).

Using operf on same samples (using spice-server-replay) and trying 2 runs
I got

run             1       2
-------------------------
before    104441   106267
after      92387    91083

So the performance increase is about 13%.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-09-04 11:04:09 +01:00
Frediano Ziglio
6001d8905e remove unused SAME_PIXEL macro
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-26 15:23:15 +01:00
Daniel P. Berrange
02d56750bd Remove trailing blank lines
Remove any blank lines at the end of all source files
2012-01-13 18:11:59 +02:00
Alexander Larsson
012bd25779 Fix spelling errors in comments and strings 2010-05-21 10:51:28 +02:00
Alexander Larsson
c97116aeb9 Relicense everything from GPL to LGPL 2.1+ 2010-04-13 22:22:15 +02:00
Yaniv Kamay
c1b79eb035 fresh start 2009-10-14 15:06:41 +02:00