Optimizing Base64 encoding/decoding

The code presented here has now been merged into master and will be part of the next release of base64-bytes.

@unsoundscapes interesting. I know that haskell under some circumstances will realize that it creates a tuple, only to immediately pattern match on it again (in the next loop iteration).
It then unboxes the tuple saving some indirection. Perhaps the jit does something similar? It would be convenient if elm could do that kind of optimization for this kind of work.

@mgold absolutely, which is why it was so nice the package already had a solid set of fuzz tests.
Also i remember some 1000000x speedups because a function just immediately returned Nothing.

2 Likes