[ANNOUNCE] VDR-1.5.12: some "micro" speed improvements

Message ID 4772E6E6.7040909@gmx.de
State New
Headers

Commit Message

Reinhard Nissl Dec. 26, 2007, 11:42 p.m. UTC
  Hi,

some more patches:

HASHSIZE should be a prime: 512 looks like a typo of 521.

oprofile and gprof showed the possibilty to speed up some OSD drawing
operations. Please find attached a patch for DrawRectangle and
DrawBitmap. BTW: text2skin will not benefit from the DrawBitmap changes
as it uses it's own copy of DrawBitmap.

oprofile also showed strreplace among the top 10 when profiling a 120
second VDR session. Please find attached a "faster" solution.

Bye.
  

Comments

Clemens Kirchgatterer Dec. 27, 2007, 9:20 a.m. UTC | #1
Reinhard Nissl <rnissl@gmx.de> wrote:

> oprofile also showed strreplace among the top 10 when profiling a 120
> second VDR session. Please find attached a "faster" solution.

i applied all your patches and indeed, vdr feels more responsive now on
the geode vdr client. no stabillity issues yet.

well done!

best regards ...
clemens
  
Georg Acher Dec. 27, 2007, 12:39 p.m. UTC | #2
On Thu, Dec 27, 2007 at 12:42:30AM +0100, Reinhard Nissl wrote:
> Hi,
> 
> some more patches:
> 
> HASHSIZE should be a prime: 512 looks like a typo of 521.

That is related to my original hash patch a few years ago. It is not a typo!
If you don't have a special distribution with clusters it doesn't matter if
the hash size is prime or not. In fact the modulo operation is slower
than the AND on old CPUs...
 
> oprofile and gprof showed the possibilty to speed up some OSD drawing
> operations. Please find attached a patch for DrawRectangle and
> DrawBitmap. BTW: text2skin will not benefit from the DrawBitmap changes
> as it uses it's own copy of DrawBitmap.

Seems that work needs to be done always twice :( I made similar improvements
for the Reel-vdr almost two years ago (replacing SetIndex by a faster
version without dirty-update). AFAIK RMM also submitted the patches. At that
time nobody was interested in them ("vdr is fast enough" or the like).
  

Patch

--- ../vdr-1.5.12-orig/tools.c	2007-11-03 16:34:07.000000000 +0100
+++ tools.c	2007-12-27 00:31:31.000000000 +0100
@@ -140,11 +142,8 @@  char *strreplace(char *s, char c1, char 
 {
   if (s) {
      char *p = s;
-     while (*p) {
-           if (*p == c1)
-              *p = c2;
-           p++;
-           }
+     while ((p = strchr(p, c1)))
+           *p++ = c2;
      }
   return s;
 }