Uploaded image for project: 'Cayenne'
  1. Cayenne
  2. CAY-1803

Optimize Expression conversion to String and EJBQL

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • None
    • 3.2.M1
    • None
    • None

    Description

      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

      Attachments

        Activity

          People

            andrus Andrus Adamchik
            andrus Andrus Adamchik
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: