hadoop-pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pradeep Kamath (JIRA)" <j...@apache.org>
Subject [jira] Created: (PIG-513) PERFORMANCE: optimize some of the code in DefaultTuple
Date Fri, 31 Oct 2008 00:32:44 GMT
PERFORMANCE: optimize some of the code in DefaultTuple

                 Key: PIG-513
                 URL: https://issues.apache.org/jira/browse/PIG-513
             Project: Pig
          Issue Type: Bug
    Affects Versions: types_branch
            Reporter: Pradeep Kamath
             Fix For: types_branch

The following areas in DefaultTuple.java can be changed:

The member methods get(), set(), getType() and isNull() all call checkBounds() which is redundant
call since all these 4 functions throw ExecException. Instead of doing a bounds check, we
can catch the IndexOutOfBounds exception in a try-catch and throw it as an ExecException

The write() method has the following unused object (d in the code below):
for (int i = 0; i < sz; i++) {
                try {
                    Object d = get(i);
                } catch (ExecException ee) {
                    throw new RuntimeException(ee);
                DataReaderWriter.writeDatum(out, mFields.get(i));
The get(i) call in the try should be replaced by the writeDatum call directly since d is never
used and there is an unncessary call to get()

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message