summaryrefslogtreecommitdiff
path: root/sc/inc/dpcache.hxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-03-16 21:44:55 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-03-16 23:24:46 -0400
commitf81d15c3bab32938b5b475e16ae2a746a7a32ea9 (patch)
tree46b789f7e751c451c84ec3b57c8fc0b8cb0473cb /sc/inc/dpcache.hxx
parentc94b4b7e0e4aeae13eed9402c1f534e694b4e992 (diff)
Use shared string pool to share string instances among string item values.
This brings down the reload time from 22 seconds to 4.3 seconds with my test document. This is what I've been looking for!
Diffstat (limited to 'sc/inc/dpcache.hxx')
-rw-r--r--sc/inc/dpcache.hxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 839f64b4bcf0..2591b3def302 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -36,6 +36,7 @@
#include <boost/noncopyable.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
+#include <boost/unordered_set.hpp>
#include <mdds/flat_segment_tree.hpp>
#include <vector>
@@ -58,6 +59,8 @@ struct ScDPNumGroupInfo;
*/
class SC_DLLPUBLIC ScDPCache : boost::noncopyable
{
+ typedef boost::unordered_set<rtl::OUString, rtl::OUStringHash> StringSetType;
+
public:
typedef std::vector<ScDPItemData> ItemsType;
typedef std::set<ScDPObject*> ObjectSetType;
@@ -112,6 +115,7 @@ private:
FieldsType maFields;
GroupFieldsType maGroupFields;
+ mutable StringSetType maStringPool;
LabelsType maLabelNames; // Stores dimension names.
mdds::flat_segment_tree<SCROW, bool> maEmptyRows;
@@ -119,6 +123,7 @@ private:
bool mbDisposing;
public:
+ const rtl::OUString* InternString(const rtl::OUString& rStr) const;
void AddReference(ScDPObject* pObj) const;
void RemoveReference(ScDPObject* pObj) const;
const ObjectSetType& GetAllReferences() const;