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

Reimar Döffinger Reimar.Doeffinger
Mon Feb 22 20:59:28 CET 2010


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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: membench.diff
Type: text/x-diff
Size: 2878 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100222/4d16831b/attachment.diff>



More information about the ffmpeg-devel mailing list