arrow
arrow copied to clipboard
[C++] Optimize base64_decode validation using lookup table
Describe the enhancement requested
The current implementation of base64_decode validates characters using base64_chars.find() per byte, which results in repeated linear searches.
This can be optimized by using a 256-entry lookup table (byte → sextet or invalid marker), allowing validation and decoding in a single pass with O(1) lookup.
This was identified during PR review and deferred to a follow-up.
Related: #49660
Component(s)
C++
Issue resolved by pull request 49748 https://github.com/apache/arrow/pull/49748