Faster Base64 Encoding/Decoding using AVX2 - Delphi 2010++ / FPC (x86/x64) by Mikerabat github: https://github.com/mikerabat/FastBase64 FastBase64 Fast base 64 encoding/decoding using AVX2 extension.
The project is working with Delphi (2010 and up) and FPC in both intel flavors - x64 and x86. It is based on the paper "Faster Base64 Encoding and Decoding using AVX2 Instructions" by Lamire et al. and the great work on: GitHub - lemire/fastbase64: SIMD-accelerated base64 codecs . This one here is basically a pure ASM version of their work.
Usage To use the code one needs to add the "FastBase64.pas" file to the your project and add the source search path to the library path so the dependencies are loaded too. This enables AVX encoding/decoding in case the AVX2 instruction set is avaliabe.
Stats The files were tested against the standard Delphi implementation that is shipped via the great Indy library. I created a small benchmark app that shows that achieves up to 10 times faster encoding/decoding speed.
Design considerations The project could use global constants but the disassembler could not handle that well so there is another variable passed to the en/decoding routines that hold a pointer to the constants.
I basically used the disassembly routines from GitHub - mikerabat/mrmath: Delphi matrix library to get the equivalent "db instructions" for the AVX set that are missing up until Delphi 11.3.
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
The project is working with Delphi (2010 and up) and FPC in both intel flavors - x64 and x86. It is based on the paper "Faster Base64 Encoding and Decoding using AVX2 Instructions" by Lamire et al. and the great work on: GitHub - lemire/fastbase64: SIMD-accelerated base64 codecs . This one here is basically a pure ASM version of their work. https://github.com/lemire/fastbase64/
I basically used the disassembly routines from GitHub - mikerabat/mrmath: Delphi matrix library to get the equivalent "db instructions" for the AVX set that are missing up until Delphi 11.3. https://github.com/mikerabat/mrmath
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3