You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "mibo (JIRA)" <ji...@apache.org> on 2019/05/10 16:01:00 UTC

[jira] [Resolved] (OLINGO-1330) SingletonPrimitiveType#getName() is expensive

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

mibo resolved OLINGO-1330.
--------------------------
       Resolution: Fixed
    Fix Version/s: (Java) V4 4.7.0

Fixed with [\[OLINGO-1330\] cache name in getName()|https://gitbox.apache.org/repos/asf?p=olingo-odata4.git;a=commit;h=24fed9b1b652344e3e1402eea1471fad6efed919].

> SingletonPrimitiveType#getName() is expensive
> ---------------------------------------------
>
>                 Key: OLINGO-1330
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1330
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-commons
>    Affects Versions: (Java) V4 4.5.0
>            Reporter: Dirk Mahler
>            Assignee: mibo
>            Priority: Major
>             Fix For: (Java) V4 4.7.0
>
>
> The implementation of SingletonPrimitiveType#getName() is expensive if monitored in the JVisualVM sampler:
>  
> {code:java}
>   @Override
>   public String getName() {
>     return getClass().getSimpleName().substring(3);
>   }
> {code}
> The main problem here is the Class#getSimpleName is a quite "complex" calculation that's exectued every time when the method is invoked. The name should be cached instead.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)