[ https://issues.apache.org/jira/browse/ARROW-7098?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Micah Kornfield resolved ARROW-7098. ------------------------------------ Fix Version/s: 1.0.0 Resolution: Fixed Issue resolved by pull request 5790 [https://github.com/apache/arrow/pull/5790] > [Java] Improve the performance of comparing two memory blocks > ------------------------------------------------------------- > > Key: ARROW-7098 > URL: https://issues.apache.org/jira/browse/ARROW-7098 > Project: Apache Arrow > Issue Type: Improvement > Components: Java > Reporter: Liya Fan > Assignee: Liya Fan > Priority: Minor > Labels: pull-request-available > Fix For: 1.0.0 > > Time Spent: 50m > Remaining Estimate: 0h > > We often use the 8-4-1 paradigm to compare two blocks of memory: > 1. First compare by 8-byte blocks in a loop > 2. Then compare by 4-byte blocks in a loop > 3. Last compare by 1-byte blocks in a loop > It can be proved that the second loop runs at most once. So we can replace > the loop with a if statement, which will save us a comparison and two jump > operations. > According to the discussion in > https://github.com/apache/arrow/pull/5508#discussion_r343973982, loop can be > expensive. -- This message was sent by Atlassian Jira (v8.3.4#803005)