Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARROW-16568: [Java] Enable skipping BOUNDS_CHECKING with setBytes and getBytes of ArrowBuf #13161

Conversation

jackylee-ch
Copy link
Contributor

We have BOUNDS_CHECKING_SKIP in ArrowBuf.setByte or ArrowBuf.getByte, it helps to remove unexpected bounds checks. However, it doesn't exists in ArrowBuf.setBytes or ArrowBuf.getBytes, which makes 10% cpu time cost for checking bounds in our environment.

@github-actions
Copy link

@github-actions
Copy link

⚠️ Ticket has not been started in JIRA, please click 'Start Progress'.

@lidavidm lidavidm changed the title ARROW-16568: [JAVA] Enable skip BOUNDS_CHECKING with setBytes and getBytes of ArrowBuf ARROW-16568: [Java] Enable skip BOUNDS_CHECKING with setBytes and getBytes of ArrowBuf May 16, 2022
Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Do you have a benchmark or any results showing the impact here?

@jackylee-ch
Copy link
Contributor Author

jackylee-ch commented May 16, 2022

image

This is the perf image for this problem, we set about billiions of String values into StringVector. As showing in image, we have 14% cpu time cost with checkIndex, which is actually unneccesary and no reallocat found. With this pr, we have 14% speed up in our environment.

BTW, We have also changed setSafe() to set() to remove the handleSafe costs.

@lidavidm lidavidm changed the title ARROW-16568: [Java] Enable skip BOUNDS_CHECKING with setBytes and getBytes of ArrowBuf ARROW-16568: [Java] Enable skipping BOUNDS_CHECKING with setBytes and getBytes of ArrowBuf May 16, 2022
@lidavidm lidavidm closed this in 0cc320c May 16, 2022
@jackylee-ch jackylee-ch deleted the skip_bounds_check_for_set_or_get_bytes branch May 17, 2022 00:11
zhouyuan pushed a commit to zhouyuan/arrow that referenced this pull request May 17, 2022
…Bytes of ArrowBuf

We have BOUNDS_CHECKING_SKIP in ArrowBuf.setByte or ArrowBuf.getByte, it helps to remove unexpected bounds checks. However, it doesn't exists in ArrowBuf.setBytes or ArrowBuf.getBytes, which makes 10% cpu time cost for checking bounds in our environment.

Closes apache#13161 from jackylee-ch/skip_bounds_check_for_set_or_get_bytes

Authored-by: stczwd <qcsd2011@163.com>
Signed-off-by: David Li <li.davidm96@gmail.com>
zhouyuan added a commit to oap-project/arrow that referenced this pull request May 17, 2022
…Bytes of ArrowBuf (#104)

We have BOUNDS_CHECKING_SKIP in ArrowBuf.setByte or ArrowBuf.getByte, it helps to remove unexpected bounds checks. However, it doesn't exists in ArrowBuf.setBytes or ArrowBuf.getBytes, which makes 10% cpu time cost for checking bounds in our environment.

Closes apache#13161 from jackylee-ch/skip_bounds_check_for_set_or_get_bytes

Authored-by: stczwd <qcsd2011@163.com>
Signed-off-by: David Li <li.davidm96@gmail.com>

Co-authored-by: stczwd <qcsd2011@163.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants