[vlc-devel] [PATCH] Added a performance check to marquee filter

Antoine Cellerier dionoea at videolan.org
Fri Jan 9 15:33:29 CET 2009


I was thinking about removing the two strchr() calls in marq and just
using something like:
p_sys->p_region->psz_text = str_fmt( p_filter, p_sys->psz_marquee, &p_sys->b_need_update );

and then modify str_fmt_time() and str_fmt_meta() in src/text/strings.c
so that they report if the format string they were given could produce
different output if it were used again.

> What is the gain of this ? You would still have to preparse the string
> from the strfmt use.

The advantage is that other modules could use that information too to
cache the string if it can't change.

> If you prefer a more general optimization ( because this string might
> be found on other str_format calls) then i would suggest to embed the
> preparsing code inside strfmt and only call localtime() when a %x is
> found, with x!=%.

That would be a bit overkill.

Regards,

-- 
Antoine Cellerier
dionoea



More information about the vlc-devel mailing list