Summary: | [patch] inline some frequently called stream functions | ||
---|---|---|---|
Product: | poppler | Reporter: | William Bader <williambader> |
Component: | general | Assignee: | poppler-bugs <poppler-bugs> |
Status: | RESOLVED MOVED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | williambader |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | patch to inline some functions in Stream.cc and Stream.h |
Description
William Bader
2015-02-12 04:25:34 UTC
This doesn't really make much sense, makes the code somewhat harder to read and makes future patching from xpdf harder for no win since those calls can't be inlined, see http://www.parashift.com/c++-faq-lite/inline-virtuals.html So i'd prefer not accepting this patch. OK. It didn't seem to make much of a performance difference since the getChar() functions are virtual and can't be inlined. I think that a better solution is making the low-level Stream interface based on filling buffers rather than passing characters one at a time. The profile above has 111M calls to one of the getChar() functions. Would it be possible to have only one non-virtual getChar() in Stream that calls a virtual function to fill a buffer as needed? At worst the buffer fill function could just load the one character that getChar() would have returned, so it would not require a redesign of streams that can provide only one character at a time. there is doGetChars, use it in the places you think that may be needed. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/poppler/poppler/issues/389. |
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.