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.
Created attachment 7068 [details] [review] un-virtual-ize getRawChar() As described in bug.
Nevermind, this patch is wrong. It always calls the getRawChar in IGetRawChar, not in the class I want. Which is why they invented virtual in C++, but I wanted to get rid of virtual, so this is no good. More testing next time before I post a patch.
;-) BTW, did you see you already have the cvs account? Once krh creates the 0.6 branch you can start commiting all your nice patches there!
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.