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

Challen updated OLINGO-421:
---------------------------
    Attachment: 0001-proxy-code-time-the-getxxx-method-with-.t1-.t3.patch

attach 0001-proxy-code-time-the-getxxx-method-with-.t1-.t3.patch , for 
ClassUtils.t1 / t2 / t3, pls use apply it :
git branch -b clientperf
git am 0001-proxy-code-time-the-getxxx-method-with-.t1-.t3.patch


> java client - further improve getter method's perf in the generated proxy 
> codes
> -------------------------------------------------------------------------------
>
>                 Key: OLINGO-421
>                 URL: https://issues.apache.org/jira/browse/OLINGO-421
>             Project: Olingo
>          Issue Type: Task
>    Affects Versions: V4 4.0.0-beta-02
>            Reporter: Challen
>            Assignee: Challen
>             Fix For: V4 4.0.0-beta-02
>
>         Attachments: 0001-proxy-code-time-the-getxxx-method-with-.t1-.t3.patch
>
>
> OLINGO-415 did enhanced the getter method's perf, but further improvement is 
> still expected. (it may be a significant code change, so targetting beta-02)
> in a test, t3 (620) is only half of t2 (1240), so the invoke() method still 
> can be optimized.
> (in AbstractStructuredInvocationHandler.java)
> ====================
>    public Object invoke(final Object proxy, final Method method, final 
> Object[] args) throws Throwable {
> +     long start1 = System.nanoTime();
>       if (method.getName().startsWith("get")) {  
>               // Here need check "get"/"set" first for better get-/set- 
> performance because
>               // the below if-statements are really time-consuming, even 
> twice slower than "get" body.
>  
>               // Assumption: for each getter will always exist a setter and 
> viceversa.
>        // get method annotation and check if it exists as expected
>  
> +      long start2 = System.nanoTime();
>        final Object res;
>        final Method getter = typeRef.getMethod(method.getName());
>  
>        final Property property = ClassUtils.getAnnotation(Property.class, 
> getter);
>        if (property == null) {
>          final NavigationProperty navProp = 
> ClassUtils.getAnnotation(NavigationProperty.class, getter);
>          if (navProp == null) {
>            throw new UnsupportedOperationException("Unsupported method " + 
> method.getName());
>          } else {
>            // if the getter refers to a navigation property ... navigate and 
> follow link if necessary
>            res = getNavigationPropertyValue(navProp, getter);
>          }
>        } else {
>          // if the getter refers to a property .... get property from wrapped 
> entity
>          res = getPropertyValue(property.name(), 
> getter.getGenericReturnType());  // inside, ClassUtils.t3 is measured 
>        }
>  
> +      ClassUtils.t2 += System.nanoTime() - start2;
> +      ClassUtils.t1 += System.nanoTime() - start1;
> ( ClassUtils.t3 is measured in  getPropertyValue() method. )
> ========================
> +             long start3 = System.nanoTime();
>              res = property == null || property.hasNullValue()
>                      ? null
>                      : CoreUtils.getObjectFromODataValue(property.getValue(), 
> type, service);
> +            ClassUtils.t3 += System.nanoTime() - start3;



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

Reply via email to