[Poppler-bugs] [Bug 8352] New: Un-virtual-ize Stream::getRawChar() for 35-45% speed boost for some pages

bugzilla-daemon at annarchy.freedesktop.org bugzilla-daemon at annarchy.freedesktop.org
Tue Sep 19 01:39:39 PDT 2006


Please do not reply to this email: if you want to comment on the bug, go to    
       
the URL shown below and enter yourcomments there.     
   
https://bugs.freedesktop.org/show_bug.cgi?id=8352          
     
           Summary: Un-virtual-ize Stream::getRawChar() for 35-45% speed
                    boost for some pages
           Product: poppler
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: general
        AssignedTo: poppler-bugs at lists.freedesktop.org
        ReportedBy: kkowalczyk at gmail.com


This patch makes Stream::getRawChar() non-virtual (actually it removes it
completely from Stream and makes it into an interface that only streams that use
StreamPredictor use implement. This makes it calling getRawChar() much faster.

Hard to believe it but on my test file that has an image that causes to use
FlateStream with StreamPredictor this small change gives 15-45% in rendering a
page (depends on the page).

There's still room for improvement for example in e.g.

int FlateStream::getChar() {
  if (pred) {
    return pred->getChar();
  } else {
    return getRawChar();
  }
}

doing the if () for every character read will probably accumulate. I think I
came up with the scheme that would implement 2 versions of each stream that
might use StreamPredictor, to eliminate this if (), but that's a bigger change.          
     
     
--           
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email         
     
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


More information about the Poppler-bugs mailing list