Re: [FFmpeg-devel] [PATCH 3/3] avformat/mpegts: use av_unlikely for detecting unknown streams

2019-01-24 Thread Carl Eugen Hoyos
2019-01-25 2:03 GMT+01:00, Marton Balint :
>
> On Fri, 25 Jan 2019, Carl Eugen Hoyos wrote:
>
>> 2019-01-24 21:38 GMT+01:00, Marton Balint :
>>> Strangely the previous commit caused a slowdown in overall performance
>>> and this fixes it. I used gcc 7.3.1. Does anybody else see this?
>>
>> No, but since this command exists nearly immediately for me
>> I see a 5% deviation even without your patch.
>
> Thanks for checking it. I tested my series on top of
> 1b126ec4087ab5d87d413116bee666495b0d2d3e, and can still reproduce the
> speedup on it. On the other hand, on current git head, I can no longer
> reproduce the speedup. Whatever this is, the fact that using av_unlikely
> fixed it is probably just luck.
>
> So considering the mixed feelings about av_(un)likely in general, I'll
> just drop patch 1 and 3.

I would love to test a command line where it makes a (very) clear
difference, I wonder a little about the claim that it would help
(measurably) on some systems but not others.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] avformat/mpegts: use av_unlikely for detecting unknown streams

2019-01-24 Thread Marton Balint



On Fri, 25 Jan 2019, Carl Eugen Hoyos wrote:


2019-01-24 21:38 GMT+01:00, Marton Balint :

Strangely the previous commit caused a slowdown in overall performance
and this fixes it. I used gcc 7.3.1. Does anybody else see this?


No, but since this command exists nearly immediately for me
I see a 5% deviation even without your patch.


Thanks for checking it. I tested my series on top of 
1b126ec4087ab5d87d413116bee666495b0d2d3e, and can still reproduce the 
speedup on it. On the other hand, on current git head, I can no longer 
reproduce the speedup. Whatever this is, the fact that using av_unlikely 
fixed it is probably just luck.


So considering the mixed feelings about av_(un)likely in general, I'll 
just drop patch 1 and 3.


Thanks,
Marton
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 3/3] avformat/mpegts: use av_unlikely for detecting unknown streams

2019-01-24 Thread Carl Eugen Hoyos
2019-01-24 21:38 GMT+01:00, Marton Balint :
> Strangely the previous commit caused a slowdown in overall performance
> and this fixes it. I used gcc 7.3.1. Does anybody else see this?

No, but since this command exists nearly immediately for me
I see a 5% deviation even without your patch.

Carl Eugen
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 3/3] avformat/mpegts: use av_unlikely for detecting unknown streams

2019-01-24 Thread Marton Balint
Strangely the previous commit caused a slowdown in overall performance and
this fixes it. I used gcc 7.3.1. Does anybody else see this?

time ffprobe -show_packets 
samples/ffmpeg-bugs/trac/ticket6132/Samsung_HDR_-_Chasing_the_Light.ts > 
/dev/null

Before:
real0m2,010s
user0m1,413s
sys 0m0,596s

After:
real0m1,948s
user0m1,355s
sys 0m0,592s

Signed-off-by: Marton Balint 
---
 libavformat/mpegts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index b04fd7b4f4..3003739b38 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -2477,7 +2477,7 @@ static int handle_packet(MpegTSContext *ts, const uint8_t 
*packet)
 pid = AV_RB16(packet + 1) & 0x1fff;
 is_start = packet[1] & 0x40;
 tss = ts->pids[pid];
-if (ts->auto_guess && !tss && is_start) {
+if (av_unlikely(ts->auto_guess && !tss && is_start)) {
 add_pes_stream(ts, pid, -1);
 tss = ts->pids[pid];
 }
-- 
2.16.4

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel