Wicket
  1. Wicket
  2. WICKET-5415

Do not initialize pages which were not rendered

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.12.0
    • Fix Version/s: 6.13.0, 7.0.0-M1
    • Component/s: wicket
    • Labels:
      None

      Description

      Since WICKET-5083 (6.8.0) Wicket initializes the page before calculating whether the page is stateless.

      We identified a performance problem when a page is constructed (and thus touched) but then ignored via setResponsePage(AnotherPage.class)/RestartResponsePage and thus is not rendered and initialized.
      In this case there is no reason to check whether the page is stateful and store it. Using browser back button will go to the previous page anyway.

      For example:

      • pageA has a link to PageB
      • in PageB's constructor a RestartResponseException(PageC.class)
      • PageC is rendered

      In this example PageB will be fully initialized in org.apache.wicket.page.RequestAdapter#commitRequest to check whether it is stateful or not.
      But there is really no reason to store it at all since PageB has never been rendered.

      In our case PageB#onInitialize was expensive (read some settings from the backend) and thus we noticed the difference.

      1. 5415.tgz
        19 kB
        Martin Grigorov

        Issue Links

          Activity

          Hide
          Martin Grigorov added a comment -

          Thanks for reminding me about it.
          It will help indeed.
          I'll debug what is wrong with REDIRECT_TO_RENDER strategy.

          Show
          Martin Grigorov added a comment - Thanks for reminding me about it. It will help indeed. I'll debug what is wrong with REDIRECT_TO_RENDER strategy.
          Hide
          Sven Meier added a comment -

          We still have WICKET-5387 open, your attached patch would solve this too.

          Show
          Sven Meier added a comment - We still have WICKET-5387 open, your attached patch would solve this too.

            People

            • Assignee:
              Martin Grigorov
              Reporter:
              Martin Grigorov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development