We spend quite a lot of time on import allocating and quickly freeing again XML properties; eg. class OOXMLBooleanValue : public OOXMLValue { protected: bool mbValue; which can only really hold two states. Instead we should have a pair of these values and simply return either a shared pointer to them or (better) as/when bug#80907 is fixed - have 2x static versions on the stack with an initial ref count set such that they are never destroyed [ in the meantime I guess a static boost::shared_ptr and a static boost::shared_ptr< > Create(bool bBool); type API might make some sense. Then of course there is the: class OOXMLIntegerValue : public OOXMLValue { protected: sal_Int32 mnValue; I strongly suspect that integer values such as '0' and '1' are some large proportion of these guys; and also our string -> integer conversion is not ultra-fast for single digits; so I would attack: case RT_Integer: { sal_Int32 nValue; pAttribs->getAsInteger(nToken,nValue); OOXMLValue::Pointer_t xValue(new OOXMLIntegerValue(nValue)); This code, and instead get the NULL terminated string from pAttribs (cf. the context there) - and pass it to a Create method. That method could then easily special case single character integers returning a reference to a static array of 10x of them - accelerating the common case, avoiding allocation, and falling back to the slower string->int conversion. Just some thoughts there; Thanks !
Jeff Stedfast committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b3d434a9701daab054981c891c645eefe1685b51 fdo#80908 - avoid lots of alloc/free of 2x boolean values. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Jeffrey Stedfast committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=84aa4d1ff29004b0aa28068b7beb21f7ebfdb239 fdo#80908 - avoid lots of alloc/free of common integer values. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Woot! This is soptimized now!
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillCpp TopicCleanup) [NinjaEdit]