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

Ramiro Polla ramiro.polla
Mon Feb 22 20:41:26 CET 2010


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...

Ramiro Polla



More information about the ffmpeg-devel mailing list