[vlc-devel] commit: Workaround braindead QT implementation of ResizeToContents ( Marian Ďurkovič )
Marian Ďurkovič
md at bts.sk
Tue Sep 22 09:27:15 CEST 2009
On Tue, 22 Sep 2009 09:03:14 +0200, Rémi Denis-Courmont wrote
> On Tue, 22 Sep 2009 08:02:07 +0200, "Marian Ďurkovič" <md at bts.sk> wrote:
> > Just to give an idea how "efficient" is the QT4's ResizeToContents, here
> > are test results on the same EPG data with different QT4 methods:
> >
> > 1) default (text cut at right window edge) 7 msec
> > 2) the "right" thing (ResizeToContents) 76 msec
> > 3) my latest workaroud (columnwidth=20000) 7 msec
> >
> > Results were obtained by putting
> > msg_Err (p_intf, "update %lld", mdate());
>
> Don't do that!
>
> First, msg_Generic() is not very fast, so you don't want to include
> it. You should fetch the two timestamps and print them outside of the measurement.
>
> Second, mdate() uses the monotonic clock. You want to use the thread
> CPU time clock instead here. With a typical desktop OS scheduler at
> 100 Hz frequency, any duration over a few milliseconds is likely to be
> totally off due to preemption.
OK, I've rewritten it using:
barrier();
clock_gettime( CLOCK_THREAD_CPUTIME_ID, &t1 );
Yes, msg_Err takes about 1 msec, but otherwise the results on my system are
almost the same:
1) 5.50 msec
2) 77.33 msec
3) 5.64 msec
With kind regards,
M.
More information about the vlc-devel
mailing list