On Mon, Feb 18, 2013 at 2:08 PM, Gary Gregory <garydgreg...@gmail.com> wrote: > How does this affect the B32 code and the common code w B64? > > Gary >
I tried to make sure the patch perturbed as little of the existing code as possible. There are no changes to the B32 or shared logic. Here's the colored diff of the only pre-existing file it touched (Base64.java). The rest of the patch is new files: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/main/java/org/apache/commons/codec/binary/Base64.java?r1=1435550&r2=1447443&diff_format=h Some of the static encode/decode methods in Base64 changed. I also re-introduced two instance methods. yours, Julius > On Feb 18, 2013, at 15:26, Thomas Neidhart <thomas.neidh...@gmail.com> wrote: > >> 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 >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org > For additional commands, e-mail: dev-h...@commons.apache.org > -- yours, Julius Davies 604-222-3310 (Home) $ sudo apt-get install cowsay $ echo "Moo." | cowsay | cowsay -n | cowsay -n http://juliusdavies.ca/cowsay/ --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org