Summary: | ~4% speedup on loading PDF through Lexer/Stream improvements | ||
---|---|---|---|
Product: | poppler | Reporter: | Krzysztof Kowalczyk <kkowalczyk> |
Component: | general | Assignee: | poppler-bugs <poppler-bugs> |
Status: | RESOLVED WONTFIX | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | x86 (IA32) | ||
OS: | Windows (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Patch as described in the bug |
Description
Krzysztof Kowalczyk
2006-09-06 00:45:19 UTC
Created attachment 6842 [details] [review] Patch as described in the bug a better approach would be to make getChar an inline function of Stream with : int getChar() { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } (which is what FileStream does, but cannot be inlined as the method is virtual) Once all classes use this single *inlined* implementation it's easy to replace all existing getChar either with an efficient fillBuf or if it's not possible with a fillBuf method that fills a one char buffer (with the existing getChar implementation). Each derived class is free to implement the buffer it needs. I started a patch along these lines a long time ago against xpdf 1.01 and lost interest when 2.0 got out before I could submit a final version. There are probably some parts worth recovering if there is any interests. I didn't keep the benchmarks but I recall the improvement was quite nice with pdftotext. The patch does not apply anymore, and since it seems you are not interested anymore in poppler development i'm closing the bug. |
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.