Commits


liyafan82 authored and Micah Kornfield committed 333d9fdfd5e
ARROW-5639: [Java] Remove floating point computation from getOffsetBufferValueCapacity Some getOffsetBufferValueCapacity methods use floating point computation to calculate the capacity, which is not necessary. (int) ((offsetBuffer.capacity() * 1.0) / OFFSET_WIDTH); It is interesting to note that JIT cannot optimize away the floating point computations: So this has performance penalty: Before: VariableWidthVectorBenchmarks.getValueCapacity avgt 5 6.570 ± 0.004 ns/op After: VariableWidthVectorBenchmarks.getValueCapacity avgt 5 5.787 ± 0.575 ns/op Author: liyafan82 <fan_li_ya@foxmail.com> Closes #4602 from liyafan82/fly_0618_mult and squashes the following commits: dd905f3d6 <liyafan82> Remove more floating point computations dee0fcf4e <liyafan82> Remove floating point computation from BaseVariableWidthVector#getOffsetBufferValueCapacity