Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4316

Improve component wiring performance (avoid NoSuchFieldException)

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 8.6.1
    • Fix Version/s: 8.6.3
    • Component/s: General
    • Security Level: Jimmy
    • gh.sprint.customfield.default.name:
      ZK 8.6.3 S1

      Description

      Steps to Reproduce

      extend GenericForwardComposer

      public class MyGenericForwardComposer extends GenericForwardComposer { 
      }
      

      apply the composer to any zk component

       <div apply="MyGenericForwardComposer"/>
      

      Start in debug mode, and set an ExceptionBreakpoint for java.lang.NoSuchFieldException

      Current Result

      The exception break point is triggered 64 times even for this very simple scenario (the same fields are queried multiple times)
      This happens everytime the page is refreshed. For every user.

      The effect multiplies with deeper class hierarchies, and multiple composers in a single page.

      Expected Result

      Caching results to avoid recurring exceptions.

      Debug Info

      Root Cause

      Classes#getAnyField
      https://github.com/zkoss/zk/blob/master/zcommon/src/org/zkoss/lang/Classes.java#L1214-L1225
      same with Classes#getAnyMethod
      https://github.com/zkoss/zk/blob/master/zcommon/src/org/zkoss/lang/Classes.java#L1176-L1194

      Workaround

      SelectorComposer which uses Annotations scanning instead of naming conventions doesn't have this problem.

        Attachments

          Activity

            People

            • Assignee:
              DevChu DevChu
              Reporter:
              cor3000 cor3000
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: