ReneNyffenegger / cpp-base64

base64 encoding and decoding with c++
Other
891 stars 311 forks source link

Optimize transcoding and decoding speed #11

Closed wbflooksky closed 4 years ago

wbflooksky commented 4 years ago

Calculate the required space for the c++ string type and allocate it once,Avoid c++ string applying space multiple times by default,Increased some speed.In the encode,define a union,converts the original copy of one character at a time into a copy of an integer,that's four characters at a time,speed up coding again,but the decoding,is based on three bytes,you cannot copy four bytes at a time,Or do you have any good Suggestions,thanks a lot.

ReneNyffenegger commented 4 years ago

I believe the newest version (1.03) is more or less following the ideas that you were outlining with your pull request. I was unable to directly merge your PR because of conflicts with the existing code base.