[FFmpeg-devel] [PATCH 1/3] base64: add benchmark

Michael Niedermayer michaelni at gmx.at
Sat Jan 21 00:28:21 CET 2012


On Fri, Jan 20, 2012 at 11:30:44PM +0100, Reimar Döffinger wrote:
> On Fri, Jan 20, 2012 at 10:57:18PM +0100, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavutil/base64.c |   13 +++++++++++++
> >  1 files changed, 13 insertions(+), 0 deletions(-)
> > 
> > diff --git a/libavutil/base64.c b/libavutil/base64.c
> > index ce23294..a791a8e 100644
> > --- a/libavutil/base64.c
> > +++ b/libavutil/base64.c
> > @@ -156,11 +156,24 @@ int main(void)
> >          { "666666",  "NjY2NjY2"},
> >          { "abc:def", "YWJjOmRlZg=="},
> >      };
> > +    char in[1024], out[2048];
> >  
> >      printf("Encoding/decoding tests\n");
> >      for (i = 0; i < FF_ARRAY_ELEMS(tests); i++)
> >          error_count += test_encode_decode(tests[i].data, strlen(tests[i].data), tests[i].encoded_ref);
> >  
> > +    memset(in, 123, sizeof(in));
> 
> Not sure how realistic the result for a constant value is, but it is ok.

applied


> 
> > +    for(i=0; i<10000; i++){
> > +        START_TIMER
> > +        av_base64_encode(out, sizeof(out), in, sizeof(in));
> > +        STOP_TIMER("encode")
> > +    }
> > +    for(i=0; i<10000; i++){
> > +        START_TIMER
> > +        av_base64_decode(in, out, sizeof(in));
> > +        STOP_TIMER("decode")
> > +    }
> 
> Maybe it would be interesting to test pure syntax check (with NULL
> destination and 0 destination size)?

ill add that later

Thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120121/ab5f4e06/attachment.asc>


More information about the ffmpeg-devel mailing list