Thank you Liya,

I will try to implement some benchmarks to see how much it impacts the performance for different numbers of bytes set each time. If I find enough evidence that bounds checking can hurt the performance I will open a PR.

Best,
Benjamin Wilhelm


On 15.10.20 14:07, Fan Liya wrote:
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 <benjamin.wilh...@knime.com>
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


Reply via email to