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-5021) [patch] avoid map look ups in a loop by using entrySet
Date Fri, 11 Feb 2011 11:29:57 GMT

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

Knut Anders Hatlen commented on DERBY-5021:

The changes look reasonable to me, although I don't think any of the changes are in particularly
performance critical code. One little problem is that the changes in EmbedConnection40 and
NetConnection40 remove code that's there to prevent a compiler warning (there must be an easier
way to do it than how we do it now, though), so now the warning is back:

$ ant -q 
    [javac] Note: /code/derby/d5021/java/engine/org/apache/derby/impl/jdbc/EmbedConnection40.java
uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] /code/derby/d5021/java/client/org/apache/derby/client/net/NetConnection40.java:349:
warning: [unchecked] unchecked conversion
    [javac] found   : java.util.Map
    [javac] required: java.util.Map<? extends java.lang.String,? extends java.lang.Class<?>>
    [javac]         Map<String, Class<?>> genericTypeMap = new HashMap<String,
    [javac]                                                                              ^
    [javac] 1 warning

Total time: 21 seconds

> [patch] avoid map look ups in a loop by using entrySet
> ------------------------------------------------------
>                 Key: DERBY-5021
>                 URL: https://issues.apache.org/jira/browse/DERBY-5021
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Server
>    Affects Versions:
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For:
>         Attachments: use_entryset_iterators.diff
>   Original Estimate: 1h
>  Remaining Estimate: 1h
> various places code walks a keyset iterator in a loop and each time thru the loop does
a map lookup for the value based on the current key. Avoid the map look ups by just iterating
with an entry set iterator.

This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message