<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Cache lcms transformed values for ICC colorspaces in getRGB(), getCMYK() and getGray()"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=68420">68420</a>
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>poppler-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Cache lcms transformed values for ICC colorspaces in getRGB(), getCMYK() and getGray()
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>Thomas.Freitag@alfa.de
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>general
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>poppler
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=84442" name="attach_84442" title="PDF-X version of ducks & roses which illustrates the effect">attachment 84442</a> <a href="attachment.cgi?id=84442&action=edit" title="PDF-X version of ducks & roses which illustrates the effect">[details]</a></span>
PDF-X version of ducks & roses which illustrates the effect

In <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - 100% CPU usage on files with GfxICCBaseColorSpace use"
   href="show_bug.cgi?id=66928">bug 66928</a> we speed up rendering of images in icc colorspaces with the usage
of getRGBLine() instead of getRGB() for images. But this will not help for PDF,
where shadings are in icc colorspaces.
I created a sample PDF from ducks & roses, which uses a lot of shadings, which
I attach here. 
Without caching already transformed values we have the following result:

time ./utils/pdftoppm -png -cropbox bugzilla/iducksNroses1.pdf  output/ducks

real    0m6.395s
user    0m5.928s
sys    0m0.020s

and it uses 852,840,264 bytes (measured with valgrind).

With a simple cache we can increase that speed:

time ./utils/pdftoppm -png -cropbox bugzilla/iducksNroses1.pdf  output/ducks

real    0m3.367s
user    0m3.284s
sys    0m0.048s

without using much more memory: 853,832,752 bytes

If You're interested, I'll create a patch after <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - 100% CPU usage on files with GfxICCBaseColorSpace use"
   href="show_bug.cgi?id=66928">bug 66928</a> and <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Poppler ignores rendering intents and always uses INTENT_RELATIVE_COLORIMETRIC"
   href="show_bug.cgi?id=34053">bug 34053</a> will be
closed.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>