accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Josh Elser (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (ACCUMULO-4067) TTimeoutTransport repeatedly uses reflection to obtain method
Date Fri, 04 Dec 2015 21:30:11 GMT

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

Josh Elser updated ACCUMULO-4067:
---------------------------------
    Priority: Major  (was: Critical)

> TTimeoutTransport repeatedly uses reflection to obtain method
> -------------------------------------------------------------
>
>                 Key: ACCUMULO-4067
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-4067
>             Project: Accumulo
>          Issue Type: Improvement
>          Components: rpc
>            Reporter: Josh Elser
>            Assignee: Josh Elser
>             Fix For: 1.6.5, 1.7.1, 1.8.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Noticed the following in TTimeoutTransport while looking at ACCUMULO-4065:
> {code}
>   private static InputStream getInputStream(Socket socket, long timeout) {
>     try {
>       Method m = NetUtils.class.getMethod("getInputStream", Socket.class, Long.TYPE);
>       return (InputStream) m.invoke(null, socket, timeout);
>     } catch (Exception e) {
>       throw new RuntimeException(e);
>     }
>   }
> {code}
> We should really just invoke {{getMethod}} once and cache the {{Method}} instance instead
of repeatedly getting it every time we create a new connection (which is often).
> Not sure if this is a "hot" enough code path to have a noticeable performance impact,
but it should be good to fix regardless.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message