[poppler] [PATCH] ~10% speedup for loading/parsing a PDF file through simple GooString optimization

Leonard Rosenthol leonardr at pdfsages.com
Mon Aug 14 09:01:56 PDT 2006

At 10:37 AM 8/14/2006, Reece Dunn wrote:
> >          What about using a smart pointer?  Something as simple as
> > std::auto_ptr<> for a start - or possibly going all the way to
> > boost::shared_ptr<>.
>These won't work as you need to call Object::release()

         No you don't.   That's all automatic in the destructor - 
EXACTLY what you want.   Go check it out ;).

>I have made several attempts at cleaning up the XPDF codebase
>as it does not make use of the C++ library (GooString vs. std::string,
>GooList vs. std::list, qsort vs. std::sort),

         Yes, that's painful indeed.  However, can we safely assume 
that all platforms on which Poppler would be used (including 
embedded) are up to date?

>  uses goto for resource
>cleanup instead of RAII (Resource Aquisition Is Initialization - i.e.
>constructors aquire a resource, destructors clean that resource up),

         Yeah, it makes for VERY ugly code...

>Q: Is there any point in having GBool/gTrue/gFalse now since only
>the very ancient of C++ compilers don't support bool/true/false?

         See above.


Leonard Rosenthol                            <mailto:leonardr at pdfsages.com>
Chief Technical Officer                      <http://www.pdfsages.com>
PDF Sages, Inc.                              215-938-7080 (voice)
                                              215-938-0880 (fax)

More information about the poppler mailing list