On 02/18/2013 08:14 PM, jul...@apache.org wrote:
> Author: julius
> Date: Mon Feb 18 19:14:31 2013
> New Revision: 1447443
> 
> URL: http://svn.apache.org/r1447443
> Log:
> CODEC-166 - Base64 could be faster.
> 
> Added:
>     
> commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/ApacheModifiedMiGBase64.java
>     
> commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/MiGBase64.original
> Modified:
>     commons/proper/codec/trunk/src/changes/changes.xml
>     
> commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java

I played around with your benchmark, and the main reason Commons Codec
is so slow compared to the other ones is because CC initializes by
default an internal buffer with a fixed size of 8192.

Adjusting the BaseNCodec.encode(byte[]) / decode(byte[]) methods to
pre-initialize the internal buffer to a better estimate (array.length *
4 / 3 in the encode case, and array.length * 3 / 4 in the decode case)
results in very similar figures compared to MiGBase and iHarder.

So I would be in favor of reverting this change and improve the existing
Base64 implementation, I can provide a patch for this.

Thomas



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to