Uploaded image for project: 'yangtools'
  1. yangtools
  2. YANGTOOLS-1082

Stop phase completion early

XMLWordPrintable

    • Icon: Story Story
    • Resolution: Done
    • Icon: Medium Medium
    • 5.0.0, 3.0.10, 4.0.8
    • None
    • parser
    • None

      Profiling shows that StatementContextBase.tryToCompletePhase() is our single hottest method during large context assembly - having ~52.5M calls.

      Splitting it up shows, that 99% of time spent in it ends up being spent in StatementContextBase.completeChildren(), also implying recursive invocation of tryToCompletePhase().

      Since each StatementContextBase tracks its finished phase, we should be able stop processing early by simple comparison - which results in trimming down the number of invocations down of tryToCompletePhase() to ~10.5M and completeChildren() to ~4.3M.

      In order to reap the benefits of this optimization, though, we must ensure that any children added do transition to the same phase.

       

            rovarga Robert Varga
            rovarga Robert Varga
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: