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

Andrus Adamchik updated CAY-1803:
---------------------------------

    Summary: Optimize Expression conversion to String and EJBQL  (was: Define 
toString() in path expressions)
    
> Optimize Expression conversion to String and EJBQL
> --------------------------------------------------
>
>                 Key: CAY-1803
>                 URL: https://issues.apache.org/jira/browse/CAY-1803
>             Project: Cayenne
>          Issue Type: Improvement
>            Reporter: Andrus Adamchik
>            Assignee: Andrus Adamchik
>            Priority: Trivial
>             Fix For: 3.2M1
>
>
> Expression.toString() is pretty heavy:
>  @Override
>     public String toString() {
>         StringWriter buffer = new StringWriter();
>         PrintWriter pw = new PrintWriter(buffer);
>         encodeAsString(pw);
>         pw.close();
>         buffer.flush();
>         return buffer.toString();
>     }
> We didn't bother much about it, as it wasn't supposed to be called in 
> runtime... Well it is sometimes:
> SelectTranslator,java:
> 433 String labelPrefix = pathExp.toString().substring("db:".length());
> And I am seeing this line occasionally in my app profiling reports. So we 
> need to override "toString" at least for ASTObjPath and ASTDbPath with a 
> lighter implementation

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

Reply via email to