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

basos g noxelia at gmail.com
Fri Jan 9 22:23:02 CET 2009


2009/1/9 Antoine Cellerier <dionoea at videolan.org>:
> 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.
>
Now i got it. You want str_fmt to report when the string contains %? stuff
But how would it be realized if not preparsing the string (searching
for % and %% ) ?


>> 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
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel
>



More information about the vlc-devel mailing list