ICEpdf
  1. ICEpdf
  2. PDF-602

Image proxy concurrency issue.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0, 5.0.1, 5.0.2
    • Fix Version/s: 5.0.3
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      any
    • Salesforce Case Reference:
    • Workaround Exists:
      Yes
    • Workaround Description:
      -Dorg.icepdf.core.imageProxy=false

      Description

      I've been working with the profiler for a few days now and have several issue that appear to contribute the blank page views.

      The first big issue was the locking associated with the Image proxy in that it wan't working correctly. It was possible for the image proxy to skip over images and not display them. This imageReference class have been reworked to use the FutureTask and Callable interface. When ample memory is provided and the thread count increased the performance gains is quite noticeable.

      Another areas of concern was the amount of time spend waiting sun.graphcs.fill. AFter doing some experimenting it became clear that painting shouldn't be in parallel. A new single thread ThreadPoolExecutor was added to the library queue up any paint requests.

      The pageComponent also was doing some awt work around annotation setLocation, setbounds and validate was being done on the painter thread. These hot spots where queued up to run on the awt thread via SwingUtilities.invokeLater().

      While working on the MipMappedImageReference I found an issue where the proxy was causing repeated scaling to fail. This issue was related to PDF-577 as well.

      To avoid thread starvation of the common thread pool in library I created one more just for the image proxy. The problem in testing was that if page has a bunch of images on it in a multipage view no futher pages would be initialized or in other words the page initialization running wouldn't get started. The page initialization is now handle by the common thread pool and image loading proxy by another pool. Page loading in a multi-page view seems to be a lot smoother now with less delays.

      And finally as an experiment I changed the default GraphicsRenderingHints for screen. The changes will paint at a slightly lower quality with the intention of painting faster.

        Activity

        Hide
        Patrick Corless added a comment -

        Closing, image proxy is now working as expected.

        Show
        Patrick Corless added a comment - Closing, image proxy is now working as expected.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Patrick Corless
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: