Skip to content

Commit

Permalink
optimize std.base64
Browse files Browse the repository at this point in the history
Remove the Unsafe varient, as it has no advantages.

Also remove the Ignore varient, because while it might be necessary
to implement S/MIME it currently has no users, and I think it would
be better implemented with a streaming API. (The blocks are only
4 long). At that time we could add a decodeBlock() function.

About a 80% speed up of Base64Decode.

opt-encode: 1008.9MiB/sec
opt-decode: 711.7MiB/sec
noopt-encode: 1.4GiB/sec
noopt-decode: 557.8MiB/sec
opt-encode: 1.5GiB/sec
opt-decode: 882.4MiB/sec
noopt-encode: 1.5GiB/sec
noopt-decode: 548.2MiB/sec
opt-encode: 1.5GiB/sec
opt-decode: 903.3MiB/sec
noopt-encode: 1.5GiB/sec
noopt-decode: 552.7MiB/sec
opt-encode: 1.5GiB/sec
opt-decode: 903.6MiB/sec
noopt-encode: 1.5GiB/sec
noopt-decode: 554.2MiB/sec
opt-encode: 1.5GiB/sec
opt-decode: 892.6MiB/sec
noopt-encode: 1.5GiB/sec
noopt-decode: 553.8MiB/sec
opt-encode: 1.4GiB/sec
opt-decode: 892.7MiB/sec
noopt-encode: 1.4GiB/sec
noopt-decode: 551.3MiB/sec
opt-encode: 1.5GiB/sec
opt-decode: 905.5MiB/sec
noopt-encode: 1.5GiB/sec
noopt-decode: 555.5MiB/sec
opt-encode: 1.5GiB/sec
opt-decode: 904.0MiB/sec
noopt-encode: 1.5GiB/sec
noopt-decode: 553.9MiB/sec
opt-encode: 1.5GiB/sec
opt-decode: 903.6MiB/sec
noopt-encode: 1.4GiB/sec
noopt-decode: 550.5MiB/sec
opt-encode: 1.5GiB/sec
opt-decode: 891.5MiB/sec
noopt-encode: 1.5GiB/sec
noopt-decode: 550.0MiB/sec
  • Loading branch information
shawnl committed Mar 31, 2019
1 parent 8659c69 commit c5ee98e
Show file tree
Hide file tree
Showing 2 changed files with 132 additions and 311 deletions.

0 comments on commit c5ee98e

Please sign in to comment.