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

Rohini Palaniswamy updated PIG-3255:
------------------------------------

    Description: 
PigStreaming.java:

 public Tuple deserialize(byte[] bytes) throws IOException {
        Text val = new Text(bytes);  
        return StorageUtil.textToTuple(val, fieldDel);
    }

Should remove new Text(bytes) copy and construct the tuple directly from the 
bytes

  was:
 public Tuple deserialize(byte[] bytes) throws IOException {
        Text val = new Text(bytes);  
        return StorageUtil.textToTuple(val, fieldDel);
    }

Should remove new Text(bytes) copy and construct the tuple directly from the 
bytes


OutputHandler.java:
{code}
Text value = new Text();
        int num = in.readLine(value);
        if (num <= 0) {
            return null;
        }
        
        byte[] newBytes = new byte[value.getLength()];
        System.arraycopy(value.getBytes(), 0, newBytes, 0, value.getLength());
        return deserializer.deserialize(newBytes);
{code}

  We can cut down another copy here if value.getLength() == 
value.getBytes().length as that would be the case mostly. 
                
> Avoid extra byte array copy in streaming deserialize
> ----------------------------------------------------
>
>                 Key: PIG-3255
>                 URL: https://issues.apache.org/jira/browse/PIG-3255
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.11
>            Reporter: Rohini Palaniswamy
>             Fix For: 0.12
>
>
> PigStreaming.java:
>  public Tuple deserialize(byte[] bytes) throws IOException {
>         Text val = new Text(bytes);  
>         return StorageUtil.textToTuple(val, fieldDel);
>     }
> Should remove new Text(bytes) copy and construct the tuple directly from the 
> bytes

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to