[FFmpeg-devel] [PATCH] print memory usage with -benchmark

Måns Rullgård mans
Mon Feb 22 21:20:00 CET 2010


Reimar D?ffinger <Reimar.Doeffinger at gmx.de> writes:

> On Mon, Feb 22, 2010 at 04:41:26PM -0300, Ramiro Polla wrote:
>> On Mon, Feb 22, 2010 at 4:33 PM, Reimar D?ffinger
>> <Reimar.Doeffinger at gmx.de> wrote:
>> > On Sun, Feb 21, 2010 at 02:17:09PM -0200, Ramiro Polla wrote:
>> >> On Sun, Feb 21, 2010 at 8:51 AM, Reimar D?ffinger
>> >> <Reimar.Doeffinger at gmx.de> wrote:
>> >> > @@ -4029,7 +4052,8 @@
>> >> > ? ? ? ? ?av_exit(1);
>> >> > ? ? ?ti = getutime() - ti;
>> >> > ? ? ?if (do_benchmark) {
>> >> > - ? ? ? ?printf("bench: utime=%0.3fs\n", ti / 1000000.0);
>> >> > + ? ? ? ?int maxrss = getmaxrss() / 1024;
>> >> > + ? ? ? ?printf("bench: utime=%0.3fs maxrss=%ikB\n", ti / 1000000.0, maxrss);
>> >>
>> >> It might be better to only print maxrss if it's nonzero:
>> >>
>> >> int maxrss = getmaxrss() / 1024;
>> >> printf("bench: utime=%0.3fs", ti / 1000000.0);
>> >> if (maxrss)
>> >> ? ? printf(" maxrss=%ikB", maxrss);
>> >> printf("\n");
>> >
>> > Why? Seems to me like more code for no advantage.
>> > And not only more code in FFmpeg but probably also in every application
>> > that wants to parse the output.
>> > For human consumption I doubt this is not useful without documentation
>> > (or reading the source or asking someone...) anyway.
>> 
>> Not really a strong opinion on this but I guess documenting "on
>> platforms that don't support this feature, memory consumption will
>> always be reported as 0" would be fine too...
>
> That's more than we can promise. A system that doesn't support it might
> set it to some other value (though that's unlikely).
> Next try, now with documentation.

I'm fine with this.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list