Fop
  1. Fop
  2. FOP-1890

O(n^2) code for adding new pages

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: fo tree
    • Labels:
      None
    • Environment:
      Operating System: All
      Platform: All
    • External issue ID:
      50636

      Description

      Adding a new page causes to iterate over all existing page sequnces and count their number of pages.

      If there is a large number of page sequences, this can take a significant percentage of the fop running time.

      I have the attached workaround in my tree for some time:
      It caches the number of pages in the page sequences, so that adding a new page is only O(1).

        Activity

        Hide
        Glenn Adams added a comment -

        batch transition to closed; if someone wishes to restore one of these to resolved in order to perform a verification step, then feel free to do so

        Show
        Glenn Adams added a comment - batch transition to closed; if someone wishes to restore one of these to resolved in order to perform a verification step, then feel free to do so
        Hide
        Andreas L. Delmelle added a comment -

        Patch applied in r1062913, with one minor change: currentPageSequenceIndex became obsolete, so removed it.

        See: http://svn.apache.org/viewvc?rev=1062913&view=rev

        Thanks for reporting, and again, for the patch!

        Show
        Andreas L. Delmelle added a comment - Patch applied in r1062913, with one minor change: currentPageSequenceIndex became obsolete, so removed it. See: http://svn.apache.org/viewvc?rev=1062913&view=rev Thanks for reporting, and again, for the patch!
        Hide
        Andreas L. Delmelle added a comment -

        Thanks for the patch!

        I will take this on and commit it soon, unless someone beats me to it. (Got some changes to the same package/class that I want to get through first...)

        Show
        Andreas L. Delmelle added a comment - Thanks for the patch! I will take this on and commit it soon, unless someone beats me to it. (Got some changes to the same package/class that I want to get through first...)
        Hide
        Martin Koegler added a comment -

        Attachment page-number-speedup.patch has been added with description: Cache number of pages

        Show
        Martin Koegler added a comment - Attachment page-number-speedup.patch has been added with description: Cache number of pages

          People

          • Assignee:
            fop-dev
            Reporter:
            Martin Koegler
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development