You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@arrow.apache.org by "Liya Fan (JIRA)" <ji...@apache.org> on 2019/06/19 08:26:00 UTC

[jira] [Updated] (ARROW-5639) [Java] Remove floating point computation from getOffsetBufferValueCapacity

     [ https://issues.apache.org/jira/browse/ARROW-5639?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Liya Fan updated ARROW-5639:
----------------------------
    Summary: [Java] Remove floating point computation from getOffsetBufferValueCapacity  (was: [Java] Remove floating point computation from BaseVariableWidthVector#getOffsetBufferValueCapacity)

> [Java] Remove floating point computation from getOffsetBufferValueCapacity
> --------------------------------------------------------------------------
>
>                 Key: ARROW-5639
>                 URL: https://issues.apache.org/jira/browse/ARROW-5639
>             Project: Apache Arrow
>          Issue Type: Improvement
>          Components: Java
>            Reporter: Liya Fan
>            Assignee: Liya Fan
>            Priority: Trivial
>              Labels: pull-request-available
>         Attachments: image-2019-06-18-20-30-17-826.png
>
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> Method BaseVariableWidthVector#getOffsetBufferValueCapacity uses 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:
>  !image-2019-06-18-20-30-17-826.png! 
> 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



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)