summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-16 13:10:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-18 15:10:52 +0200
commit787525a314de9c8178d0fedcd71ddbd08ec41a55 (patch)
tree06672e9e203f5a3a8ea53c4a3c4b0bb0767cfaa2 /include
parentecf456d067346d49d7e2a366434477fa7de06d8a (diff)
tdf#125254 Performance: A spreadsheet opens too slow, NameSpaceEntry
NameSpaceEntry does not need to be a weak object, it is sufficient to be ref-counted. The empty string in SvXMLNamespaceMap can be statically allocated. Don't allocate a NameSpaceEntry in GetKeyByAttrName_ if we don't intend to cache it. Takes the load time from 39.5s to 38.5s. Change-Id: I4a9a1296af84c12d44e9b3ff354297f37d29f1e8 Reviewed-on: https://gerrit.libreoffice.org/72515 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/xmloff/nmspmap.hxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/xmloff/nmspmap.hxx b/include/xmloff/nmspmap.hxx
index 1eb0f8f15b95..9c4c57393200 100644
--- a/include/xmloff/nmspmap.hxx
+++ b/include/xmloff/nmspmap.hxx
@@ -30,7 +30,7 @@
#include <sal/types.h>
#include <rtl/ustring.hxx>
#include <rtl/ref.hxx>
-#include <cppuhelper/weak.hxx>
+#include <salhelper/simplereferenceobject.hxx>
#include <limits.h>
@@ -39,7 +39,7 @@ const sal_uInt16 XML_NAMESPACE_NONE = USHRT_MAX-1;
const sal_uInt16 XML_NAMESPACE_UNKNOWN = USHRT_MAX;
const sal_uInt16 XML_NAMESPACE_UNKNOWN_FLAG = 0x8000;
-class NameSpaceEntry : public cppu::OWeakObject
+class NameSpaceEntry : public salhelper::SimpleReferenceObject
{
public:
// sName refers to the full namespace name
@@ -47,7 +47,7 @@ public:
// sPrefix is the prefix used to declare a given item to be from a given namespace
OUString sPrefix;
// nKey is the unique identifier of a namespace
- sal_uInt16 nKey;
+ sal_uInt16 nKey;
};
typedef ::std::pair < sal_uInt16, OUString > QNamePair;
@@ -65,12 +65,11 @@ struct QNamePairHash
typedef std::unordered_map < QNamePair, OUString, QNamePairHash > QNameCache;
typedef std::unordered_map < OUString, ::rtl::Reference <NameSpaceEntry > > NameSpaceHash;
-typedef std::map < sal_uInt16, ::rtl::Reference < NameSpaceEntry > > NameSpaceMap;
+typedef std::unordered_map < sal_uInt16, ::rtl::Reference < NameSpaceEntry > > NameSpaceMap;
class XMLOFF_DLLPUBLIC SvXMLNamespaceMap
{
- const OUString sXMLNS;
- const OUString sEmpty;
+ OUString sXMLNS;
NameSpaceHash aNameHash;
mutable NameSpaceHash aNameCache;