songgaoye opened a new pull request, #3684:
URL: https://github.com/apache/brpc/pull/3684

   ### What problem does this PR solve?
   
   Issue Number: resolve 
   
   Problem Summary:
   
   Base64 encoding and decoding use scalar implementations on x86 even when 
AVX2 is available, limiting throughput for medium and large payloads.
   What is changed and the side effects?
   Changed:
   - Add an AVX2 Base64 codec derived from aklomp/base64, with BSD-2-Clause 
attribution.
   - Dispatch to AVX2 only on supported x86 CPUs.
   - Use measured thresholds to retain the scalar path for small inputs:
     - Encode: AVX2 from 32 bytes.
     - Decode: AVX2 from 256 bytes of Base64 text.
   - Add unit and fuzz coverage for binary round trips and invalid input.
   - Add reproducible scalar and AVX2 benchmark targets via 
BUILD_BASE64_BENCHMARKS.
   Side effects:
   - Performance effects:
     - On an Intel i7-10700, AVX2 improves encode throughput by roughly 5–12x 
and decode throughput by roughly 1.4–4.7x for sufficiently large inputs.
     - Small payloads continue to use the scalar path.
   
   - Breaking backward compatibility: 
   
   ---
   ### Check List:
   - Please make sure your changes are compilable.
   - When providing us with a new feature, it is best to add related tests.
   - Please follow [Contributor Covenant Code of 
Conduct](https://github.com/apache/brpc/blob/master/CODE_OF_CONDUCT.md).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to