lok: encourage more sharing of config Node pages.
Profiles show lots of probe:do_wp_page events from things like configmgr::Access::getUnmodifiedChild - as when we read we touch lots of Node reference counts - un-necessarily. So - reduce un-necessary reference counting thrash here in the lok case through the environment variable. Quite possibly this would also be safe and beneficial for the desktop app - needs measurement. measuring with coolmap and an empty hello-world.odt before & after: before: unshared 3634 (14536kB) unshared 3631 (14524kB) unshared 3605 (14420kB) after: unshared 3578 (14312kB) unshared 3613 (14452kB) unshared 3599 (14396kB) Not hugely encouraging, perhaps there is another page touch underneath we'll find when this is addressed. Change-Id: I8ac74c5fcd17f8699139e914a7076a7848456e2a Signed-off-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175197 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182349 Tested-by: Jenkins
This commit is contained in:
committed by
Caolán McNamara
parent
b30c061989
commit
f05302c3df
@@ -492,6 +492,10 @@ Components::Components(
|
||||
{
|
||||
assert(context.is());
|
||||
lock_ = lock();
|
||||
|
||||
bool staticize = !!getenv("SAL_CONFIG_STATICIZE");
|
||||
Node::setStaticizedFlag(staticize);
|
||||
|
||||
OUString conf(expand(u"${CONFIGURATION_LAYERS}"_ustr));
|
||||
int layer = 0;
|
||||
for (sal_Int32 i = 0;;) {
|
||||
@@ -629,6 +633,8 @@ Components::Components(
|
||||
}
|
||||
i = n;
|
||||
}
|
||||
|
||||
Node::setStaticizedFlag(false);
|
||||
}
|
||||
|
||||
Components::~Components()
|
||||
|
||||
@@ -65,7 +65,18 @@ rtl::Reference< Node > Node::getMember(OUString const & name) {
|
||||
return i == members.end() ? rtl::Reference< Node >() : i->second;
|
||||
}
|
||||
|
||||
Node::Node(int layer): layer_(layer), finalized_(Data::NO_LAYER) {}
|
||||
bool Node::CreateStaticizedNodes = false;
|
||||
|
||||
void Node::setStaticizedFlag(bool staticized)
|
||||
{
|
||||
CreateStaticizedNodes = staticized;
|
||||
}
|
||||
|
||||
Node::Node(int layer): layer_(layer), finalized_(Data::NO_LAYER)
|
||||
{
|
||||
if (CreateStaticizedNodes)
|
||||
staticize();
|
||||
}
|
||||
|
||||
Node::Node(const Node & other):
|
||||
SimpleReferenceObject(), layer_(other.layer_), finalized_(other.finalized_)
|
||||
|
||||
@@ -50,6 +50,9 @@ public:
|
||||
void setLayer(int layer);
|
||||
int getLayer() const { return layer_;}
|
||||
|
||||
/// when @staticized is set all new nodes will not ref-count
|
||||
static void setStaticizedFlag(bool staticized);
|
||||
|
||||
void setFinalized(int layer);
|
||||
int getFinalized() const { return finalized_;}
|
||||
|
||||
@@ -67,6 +70,7 @@ private:
|
||||
int layer_;
|
||||
int finalized_;
|
||||
OUString description_;
|
||||
static bool CreateStaticizedNodes;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user