db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knut Anders Hatlen (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-2920) Share code between readExternal() and readExternalFromArray()
Date Fri, 09 Nov 2012 12:42:12 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2920?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493970#comment-13493970
] 

Knut Anders Hatlen commented on DERBY-2920:
-------------------------------------------

I also ran a modified variant of ReadInts2 where half the columns were integers and the other
half boolean, in case the run-time compiler was able to optimize the calls in the original
test more aggressively because it detected that all calls to DataType.readExternalFromArray()
would end up calling SQLInteger.readExternal(). That experiment also resulted in ~0.1% difference.
I think this means the code duplication doesn't provide any significant benefit on modern
JVMs, so I committed the patch with revision 1407432. If we find cases where this change causes
measurable performance loss, we can add overrides for the affected data types.
                
> Share code between readExternal() and readExternalFromArray()
> -------------------------------------------------------------
>
>                 Key: DERBY-2920
>                 URL: https://issues.apache.org/jira/browse/DERBY-2920
>             Project: Derby
>          Issue Type: Improvement
>          Components: Services, SQL
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>              Labels: derby_triage10_10
>             Fix For: 10.10.0.0
>
>         Attachments: d2920-1a.diff, ReadInts2.java, ReadInts.java
>
>
> Most of the implementations of DataValueDescriptor.readExternalFromArray(ArrayInputStream)
are identical to their corresponding Externalizable.readExternal(ObjectInput) methods. Since
ArrayInputStream implements ObjectInput, readExternalFromArray() could in those cases just
have forwarded calls to readExternal() instead of duplicating the code. A default forwarding
implementation of readExternalFromArray() could be placed in org.apache.derby.iapi.types.DataType,
and all the existing implementations, except those with optimizations for ArrayInputStream,
could be removed.

--
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

Mime
View raw message