[MPlayer-dev-eng] [PATCH] Parsing simplification in vobsub

ubitux ubitux at gmail.com
Tue Apr 13 21:50:45 CEST 2010


On Tue, Apr 13, 2010 at 09:37:24PM +0200, Reimar Döffinger wrote:
> On Tue, Apr 13, 2010 at 03:22:04PM +0200, ubitux wrote:
> > On Tue, Apr 13, 2010 at 08:00:45AM +0200, Reimar Döffinger wrote:
> > > On Tue, Apr 13, 2010 at 04:54:58AM +0200, ubitux wrote:
> > > > Are you interested in that kind of patches? The attached patch shows a
> > > > simpler way of parsing timestamp/filepos lines. I can also do it for
> > > > parse_origin and parse_id, but I'd like to know if this can be accepted.
> > > 
> > > Needs some speed testing, sscanf is _incredibly_ slow, making this code about
> > > 10x slower can be quite an issue.
> > 
> > Well, sure it's slower, but not 10x. This is what I got with the bench
> > file in attachment:
> > 
> > % ./a.out
> > manual: 2004721 us
> > sscanf: 5793554 us
> 
> If I interpret this correctly, I think this means that MPlayer startup time
> will increase from 2 to nearly 6 seconds.

What? No no... Look at the bench source code, I just made 10000000 tests
with each function. There won't be more than 1500 sscanf made (never saw
more than 1300 subtitles) while playing a movie.

I also try a mplayer -benchmark with and without the patch, and results
are nearly the same; I even got better results (100ms...) with sscanf one,
and surely it's not due to my changes. It really does not influence
general performances.

-- 
ubitux



More information about the MPlayer-dev-eng mailing list