Hi Benjamin, Nice catch!
The code has been like this for quite some time. I think one reason is that the 'setBytes' and 'getBytes' APIs support manipulating data in large batches, so it is less performance-critical. IMO, it is reasonable to respect the constant to improve performance. Best, Liya Fan On Thu, Oct 15, 2020 at 7:09 PM Benjamin Wilhelm <[email protected]> wrote: > Hi all, > > I have a very specific question about the `ArrowBuf` implementation in > the Java project. > There is this constant `BOUNDS_CHECKING_ENABLED` which enables/disables > checking of the bounds when accessing the buffer. However, the > `getBytes` and `setBytes` implementations ignore this constant and > always check the bounds. What is the reason for this? Wouldn't it make > sense if each method respects this constant? > > Thank you! > Benjamin Wilhelm >
