Skip to content

Optimized the Base64 encoding by AVX512VL instructions to provide known fastest performance.

Rodrigo Muino Tomonari requested to merge github/fork/lucshi/my-branch into main

This optimization only applies to Linux X86_64 at present. The considerations is that AVX512VL is not a very new technology after 2018 and the main computing intensive AWS EC2 instances have been based on Icelake. The users care about the performance gain of Base64 encoding may mainly work on new arch machine and have specific requirements of top performance. The purpose of this optimization is to provide the known fastest solution for base64 encoding with no change to Node.js building. It uses GCC pragma to enable this optimization according to the building platform and uses GCC runtime definitions to enable on supported platforms(new arch running Linux). The code is based on WojciechMula's AVX512VL Base64 project as the known fastest solution, which is faster than AVX512F/AVX512VBMI.The measurement of this patch shows 2.4X performance (+140% gain) using benchmark/buffers/buffer- base64-encoding micro bench on AWS EC2 m6i.large instances.

Merge request reports

Loading