On 11/11/2013 06:37 PM, Paul Eggert wrote:
> Pádraig Brady wrote:
>> + static const char b64c[64] =
>> +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
> ...
>> + static const char b64c[64] =
>> "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
>
>
Pádraig Brady wrote:
> + static const char b64c[64] =
> +"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
...
> + static const char b64c[64] =
> "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
There only needs to be one copy of b64c.
> + if ((inl
On 11/11/2013 04:07 PM, Pádraig Brady wrote:
> --- a/lib/base64.c
> +++ b/lib/base64.c
> - while (inlen && outlen)
> + /* Note the outlen constraint can be enforced at compile time,
> + while the inlen can change at runtime at the end of input.
> + But the common case when reading large
Avoid conditionals in the central base64 encoding loop,
which was seen to give a 60% throughput improvement
with the base64 utility from coreutils:
$ truncate -s100MiB file.in
$ time base64-old -w0 < file.in >/dev/null
real 0m0.302s
$ time base64-new -w0 < file.in >/dev/null
real 0m0.182s
* lib