diff mbox

[FFmpeg-devel,3/3] avformat/aviobuf: increase buffer size to 128k

Message ID 20170604133507.20614-3-cus@passwd.hu
State New
Headers show

Commit Message

Marton Balint June 4, 2017, 1:35 p.m. UTC
Another huge performance improvement when using SMB/CIFS as output.

Signed-off-by: Marton Balint <cus@passwd.hu>
---
 libavformat/aviobuf.c     | 2 +-
 tests/ref/seek/lavf-alaw  | 3 +--
 tests/ref/seek/lavf-mulaw | 3 +--
 3 files changed, 3 insertions(+), 5 deletions(-)

Comments

Michael Niedermayer June 4, 2017, 11:09 p.m. UTC | #1
On Sun, Jun 04, 2017 at 03:35:07PM +0200, Marton Balint wrote:
> Another huge performance improvement when using SMB/CIFS as output.
> 
> Signed-off-by: Marton Balint <cus@passwd.hu>
> ---
>  libavformat/aviobuf.c     | 2 +-
>  tests/ref/seek/lavf-alaw  | 3 +--
>  tests/ref/seek/lavf-mulaw | 3 +--
>  3 files changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
> index 7d1b385253..36eb093a3a 100644
> --- a/libavformat/aviobuf.c
> +++ b/libavformat/aviobuf.c
> @@ -33,7 +33,7 @@
>  #include "url.h"
>  #include <stdarg.h>
>  
> -#define IO_BUFFER_SIZE 32768
> +#define IO_BUFFER_SIZE 131072
>  

this is changed for all protocols not just the ones tested.
also i remember some patch that changes te buffer size for some
protocols, not sure what happened to that.
and theres the short_seek stuff, it might make sense to adjust that
too

[...]
Marton Balint June 4, 2017, 11:47 p.m. UTC | #2
On Mon, 5 Jun 2017, Michael Niedermayer wrote:

> On Sun, Jun 04, 2017 at 03:35:07PM +0200, Marton Balint wrote:
>> Another huge performance improvement when using SMB/CIFS as output.
>>
>> Signed-off-by: Marton Balint <cus@passwd.hu>
>> ---
>>  libavformat/aviobuf.c     | 2 +-
>>  tests/ref/seek/lavf-alaw  | 3 +--
>>  tests/ref/seek/lavf-mulaw | 3 +--
>>  3 files changed, 3 insertions(+), 5 deletions(-)
>>
>> diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
>> index 7d1b385253..36eb093a3a 100644
>> --- a/libavformat/aviobuf.c
>> +++ b/libavformat/aviobuf.c
>> @@ -33,7 +33,7 @@
>>  #include "url.h"
>>  #include <stdarg.h>
>>
>> -#define IO_BUFFER_SIZE 32768
>> +#define IO_BUFFER_SIZE 131072
>>
>
> this is changed for all protocols not just the ones tested.
> also i remember some patch that changes te buffer size for some
> protocols, not sure what happened to that.
> and theres the short_seek stuff, it might make sense to adjust that
> too

A less intrusive approach is to set the buffer size for the file protocol 
only and only if a file is opened for writing. In that case, the fate 
test resuls will remain the same as well.

Regards,
Marton
diff mbox

Patch

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 7d1b385253..36eb093a3a 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -33,7 +33,7 @@ 
 #include "url.h"
 #include <stdarg.h>
 
-#define IO_BUFFER_SIZE 32768
+#define IO_BUFFER_SIZE 131072
 
 /**
  * Do seeks within this distance ahead of the current buffer by skipping
diff --git a/tests/ref/seek/lavf-alaw b/tests/ref/seek/lavf-alaw
index 4b1f8fbc02..d8e99b6957 100644
--- a/tests/ref/seek/lavf-alaw
+++ b/tests/ref/seek/lavf-alaw
@@ -15,8 +15,7 @@  ret: 0         st: 0 flags:0  ts: 0.364989
 ret: 0         st: 0 flags:1 dts: 0.364989 pts: 0.364989 pos:   8048 size:  1024
 ret: 0         st: 0 flags:1  ts:-0.740816
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret:-EOF
+ret:-1         st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.047483 pts: 1.047483 pos:  23097 size:  1024
 ret: 0         st: 0 flags:0  ts:-0.058322
diff --git a/tests/ref/seek/lavf-mulaw b/tests/ref/seek/lavf-mulaw
index 4b1f8fbc02..d8e99b6957 100644
--- a/tests/ref/seek/lavf-mulaw
+++ b/tests/ref/seek/lavf-mulaw
@@ -15,8 +15,7 @@  ret: 0         st: 0 flags:0  ts: 0.364989
 ret: 0         st: 0 flags:1 dts: 0.364989 pts: 0.364989 pos:   8048 size:  1024
 ret: 0         st: 0 flags:1  ts:-0.740816
 ret: 0         st: 0 flags:1 dts: 0.000000 pts: 0.000000 pos:      0 size:  1024
-ret: 0         st:-1 flags:0  ts: 2.153336
-ret:-EOF
+ret:-1         st:-1 flags:0  ts: 2.153336
 ret: 0         st:-1 flags:1  ts: 1.047503
 ret: 0         st: 0 flags:1 dts: 1.047483 pts: 1.047483 pos:  23097 size:  1024
 ret: 0         st: 0 flags:0  ts:-0.058322