You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@crunch.apache.org by "Micah Whitacre (JIRA)" <ji...@apache.org> on 2017/03/17 12:03:41 UTC

[jira] [Closed] (CRUNCH-639) Writable Bytes does an unnecessary copy

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

Micah Whitacre closed CRUNCH-639.
---------------------------------
    Resolution: Won't Fix
      Assignee: Micah Whitacre  (was: Josh Wills)

> Writable Bytes does an unnecessary copy
> ---------------------------------------
>
>                 Key: CRUNCH-639
>                 URL: https://issues.apache.org/jira/browse/CRUNCH-639
>             Project: Crunch
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Stephen Patel
>            Assignee: Micah Whitacre
>            Priority: Minor
>
> In the Writable.bytes() Output MapFn, an unnecessary (I believe) copy of the incoming ByteBuffer occurs[0].
> Current:
> {code}
> BytesWritable bw = new BytesWritable();
> bw.set(input.array(), input.arrayOffset(), input.limit()); <- copies the array
> {code}
> Proposed:
> {code}
> BytesWritable bw = new BytesWritable(input.array()); 
> {code}
> [0]: https://github.com/apache/crunch/blob/apache-crunch-0.15.0/crunch-core/src/main/java/org/apache/crunch/types/writable/Writables.java#L271



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)